/**
 * Portal do colaborador do check-list.
 * Reaproveita as variáveis e os componentes .ag-chk-* do ag-app.css.
 */

#ag-checklist-portal,
#ag-checklist-portal *,
#ag-checklist-portal *::before,
#ag-checklist-portal *::after { box-sizing: border-box; }

.ag-ckp {
	font-family: var(--ag-font);
	color: var(--ag-text);
	max-width: 760px;
	margin: 0 auto;
	padding: 0 16px 48px;
}

/* Cabeçalho */
.ag-ckp-header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 16px 0;
	border-bottom: 1px solid var(--ag-border);
	margin-bottom: 20px;
}
.ag-ckp-logo { max-height: 44px; max-width: 150px; object-fit: contain; }
.ag-ckp-emp { font-weight: 700; font-size: 16px; color: var(--ag-heading); }
.ag-ckp-user { margin-left: auto; display: flex; align-items: center; gap: 12px; font-size: 14px; color: var(--ag-muted); }
.ag-ckp-logout {
	border: 1px solid var(--ag-border); background: var(--ag-surface); color: var(--ag-text);
	border-radius: var(--ag-radius-sm); padding: 7px 14px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: var(--ag-font);
}
.ag-ckp-logout:hover { background: var(--ag-surface-2); }

/* Login */
.ag-ckp-login { display: flex; justify-content: center; padding: 24px 0; }
.ag-ckp-card {
	width: 100%; max-width: 380px; background: var(--ag-surface);
	border: 1px solid var(--ag-border); border-radius: var(--ag-radius); padding: 28px 24px;
	box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}
.ag-ckp-card h2 { margin: 0 0 6px; font-size: 20px; color: var(--ag-heading); }
.ag-ckp-card p { margin: 0 0 20px; color: var(--ag-muted); font-size: 14px; line-height: 1.5; }
.ag-ckp-field { margin-bottom: 14px; }
.ag-ckp-field label { display: block; font-size: 13px; font-weight: 600; color: var(--ag-text); margin-bottom: 6px; }
.ag-ckp-field input {
	width: 100%; height: 46px; border: 1px solid var(--ag-border); border-radius: var(--ag-radius-sm);
	padding: 0 14px; font-size: 15px; font-family: var(--ag-font); background: var(--ag-surface); color: var(--ag-text);
}
.ag-ckp-field input:focus { outline: none; border-color: var(--ag-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ag-primary) 18%, transparent); }

/* Botões */
.ag-ckp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	border: 1px solid var(--ag-border); background: var(--ag-surface); color: var(--ag-text);
	border-radius: var(--ag-radius-sm); padding: 10px 18px; font-size: 14px; font-weight: 700; cursor: pointer; font-family: var(--ag-font);
}
.ag-ckp-btn:hover { background: var(--ag-surface-2); }
.ag-ckp-btn--primary { background: var(--ag-primary); border-color: var(--ag-primary); color: #fff; }
.ag-ckp-btn--primary:hover { filter: brightness(0.95); background: var(--ag-primary); }
.ag-ckp-btn--primary:disabled { opacity: 0.6; cursor: default; }

/* Protege texto, fundo e borda contra regras de hover/disabled do tema do site. */
#ag-checklist-portal button.ag-ckp-btn {
	-webkit-appearance: none !important; appearance: none !important;
	background: var(--ag-surface) !important; border: 1px solid var(--ag-border) !important;
	color: var(--ag-text) !important; text-decoration: none !important;
}
#ag-checklist-portal button.ag-ckp-btn:hover,
#ag-checklist-portal button.ag-ckp-btn:focus-visible {
	background: var(--ag-surface-2) !important; border-color: var(--ag-primary) !important;
	color: var(--ag-heading) !important;
}
#ag-checklist-portal button.ag-ckp-btn.ag-ckp-btn--primary,
#ag-checklist-portal button.ag-ckp-btn.ag-ckp-btn--primary:hover,
#ag-checklist-portal button.ag-ckp-btn.ag-ckp-btn--primary:focus-visible {
	background: var(--ag-primary) !important; border-color: var(--ag-primary) !important;
	color: #fff !important;
}
#ag-checklist-portal button.ag-ckp-btn:disabled {
	background: var(--ag-surface) !important; border-color: var(--ag-border) !important;
	color: var(--ag-muted) !important; opacity: .58; cursor: default;
}
#ag-checklist-portal button.ag-ckp-btn.ag-ckp-btn--primary:disabled {
	background: var(--ag-primary) !important; border-color: var(--ag-primary) !important;
	color: #fff !important;
}
.ag-ckp-btn--sm { padding: 7px 13px; font-size: 13px; }
.ag-ckp-btn--block { width: 100%; height: 50px; font-size: 15px; }

/* Corpo / lista */
.ag-ckp-section-title { font-size: 13px; text-transform: uppercase; letter-spacing: .5px; font-weight: 700; color: var(--ag-muted); margin-bottom: 14px; }
.ag-ckp-loading { padding: 28px; text-align: center; color: var(--ag-muted); }
.ag-ckp-empty {
	display: flex; flex-direction: column; gap: 6px; align-items: center; text-align: center;
	padding: 40px 20px; border: 1px dashed var(--ag-border); border-radius: var(--ag-radius); background: var(--ag-surface);
}
.ag-ckp-empty strong { font-size: 17px; color: var(--ag-heading); }
.ag-ckp-empty span { color: var(--ag-muted); font-size: 14px; }

.ag-ckp-cards { display: flex; flex-direction: column; gap: 12px; }
.ag-ckp-card.ag-ckp-card { width: 100%; }
.ag-ckp-cards .ag-ckp-card {
	display: flex; align-items: center; gap: 14px; text-align: left;
	background: var(--ag-surface); border: 1px solid var(--ag-border); border-radius: var(--ag-radius);
	padding: 12px; cursor: pointer; font-family: var(--ag-font); transition: border-color .15s, box-shadow .15s;
}
.ag-ckp-cards .ag-ckp-card:hover { border-color: var(--ag-primary); box-shadow: 0 6px 18px rgba(15, 23, 42, 0.07); }
.ag-ckp-card-foto { width: 84px; height: 64px; border-radius: 10px; overflow: hidden; flex-shrink: 0; background: var(--ag-surface-2); }
.ag-ckp-card-foto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ag-ckp-card-foto--none { display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--ag-muted); }
.ag-ckp-card-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.ag-ckp-card-info strong { font-size: 15.5px; color: var(--ag-heading); }
.ag-ckp-card-info span { font-size: 13px; color: var(--ag-muted); }
.ag-ckp-card-go { margin-left: auto; font-size: 13px; font-weight: 700; color: var(--ag-primary); white-space: nowrap; }

/* Preenchimento */
.ag-ckp-back { background: none; border: none; color: var(--ag-primary); font-weight: 600; font-size: 14px; cursor: pointer; padding: 0; margin-bottom: 14px; font-family: var(--ag-font); }
.ag-ckp-veic { background: var(--ag-surface-2); border: 1px solid var(--ag-border); border-radius: var(--ag-radius); padding: 12px 14px; margin-bottom: 18px; display: flex; flex-direction: column; gap: 3px; }
.ag-ckp-veic strong { font-size: 16px; color: var(--ag-heading); }
.ag-ckp-veic span { font-size: 13px; color: var(--ag-muted); }
.ag-ckp-actions { margin-top: 20px; }

/* Preenchimento paginado e rascunho */
.ag-ckp-progress { margin: 4px 0 16px; }
.ag-ckp-progress > span { display: block; margin-bottom: 7px; color: var(--ag-muted); font-size: 12px; font-weight: 700; text-align: right; }
.ag-ckp-progress > div { height: 7px; overflow: hidden; border-radius: 999px; background: var(--ag-surface-3); }
.ag-ckp-progress i { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--ag-primary); transition: width .2s ease; }
.ag-ckp-draft-note {
	margin: -4px 0 14px; padding: 8px 11px; border: 1px solid var(--ag-pos);
	border-radius: var(--ag-radius-sm); color: var(--ag-pos); background: var(--ag-pos-bg);
	font-size: 12.5px; font-weight: 600;
}
.ag-ckp-step[hidden] { display: none !important; }
.ag-ckp-step .ag-chk-item { min-height: 270px; padding: 20px; display: flex; flex-direction: column; justify-content: flex-start; }
.ag-ckp-step .ag-chk-anexo { margin-top: 14px; }
.ag-ckp-help { margin: 10px 0 0; color: var(--ag-muted); font-size: 12.5px; line-height: 1.45; }
.ag-chk-obs--final { min-height: 150px; }
.ag-ckp-nav { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 16px; flex-wrap: wrap; }
.ag-ckp-nav [data-progress] { margin-right: auto; }

/* Múltiplas fotos e ampliação */
.ag-chk-anexo-prev { display: grid; grid-template-columns: repeat(auto-fill, 112px); gap: 8px; width: 100%; min-width: 0; }
.ag-ckp-photo { position: relative; display: inline-block; width: 112px; height: 84px; }
.ag-ckp-photo-open {
	width: 100%; height: 100%; padding: 0; overflow: hidden; border: 1px solid var(--ag-border);
	border-radius: 9px; background: var(--ag-surface-2); cursor: zoom-in;
}
.ag-ckp-photo-open img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ag-ckp-photo-remove {
	position: absolute; top: -7px; right: -7px; width: 25px; height: 25px; padding: 0;
	border: 2px solid #fff; border-radius: 999px; background: var(--ag-neg); color: #fff;
	font-size: 17px; line-height: 20px; cursor: pointer;
}
.ag-ckp-lightbox {
	position: fixed; inset: 0; z-index: 100000; display: flex; align-items: center; justify-content: center;
	padding: 24px; background: rgba(15, 23, 42, .88); cursor: zoom-out;
}
.ag-ckp-lightbox img { max-width: min(1100px, 94vw); max-height: 90vh; object-fit: contain; border-radius: 10px; box-shadow: 0 20px 60px rgba(0, 0, 0, .45); }
.ag-ckp-lightbox button {
	position: fixed; top: 14px; right: 18px; width: 44px; height: 44px; padding: 0;
	border: 0; border-radius: 999px; background: rgba(255, 255, 255, .16); color: #fff;
	font-size: 30px; line-height: 40px; cursor: pointer;
}

/* Toast */
.ag-ckp-toast {
	position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px);
	background: #1e293b; color: #fff; padding: 12px 20px; border-radius: 10px; font-size: 14px; font-weight: 600;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2); opacity: 0; transition: opacity .2s, transform .2s; z-index: 99999; max-width: 90vw; text-align: center;
}
.ag-ckp-toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.ag-ckp-toast--err { background: var(--ag-neg); }
.ag-ckp-toast--ok { background: var(--ag-pos); }

.ag-ckp [hidden],
.ag-ckp-btn[hidden] { display: none !important; }
.ag-ckp-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.ag-ckp-type { min-height: 150px; display: flex; flex-direction: column; align-items: flex-start; justify-content: center; gap: 8px; padding: 22px; border: 1px solid var(--ag-border); border-radius: 16px; background: var(--ag-surface); color: var(--ag-text); text-align: left; cursor: pointer; box-shadow: var(--ag-shadow); }
.ag-ckp-type:hover, .ag-ckp-type:focus-visible { border-color: var(--ag-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--ag-primary) 15%, transparent); outline: none; }
.ag-ckp-type strong { font-size: 17px; color: var(--ag-heading); }
.ag-ckp-type span { color: var(--ag-muted); font-size: 13px; line-height: 1.5; }

@media (max-width: 480px) {
	.ag-ckp-type-grid { grid-template-columns: 1fr; }
	.ag-ckp-card-go { display: none; }
	.ag-ckp { padding: 0 12px 40px; }
	.ag-ckp-step .ag-chk-item { min-height: 330px; padding: 16px; }
	.ag-chk-head { align-items: flex-start; flex-direction: column; }
	.ag-chk-status { width: 100%; }
	.ag-chk-status .ag-chk-btn { flex: 1; justify-content: center; }
	.ag-ckp-nav { display: grid; grid-template-columns: 1fr 1fr; }
	.ag-ckp-nav [data-progress] { grid-column: 1 / -1; grid-row: 2; margin-right: 0; }
	.ag-ckp-nav [data-save] { grid-column: 1 / -1; }
	.ag-chk-anexo-prev { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.ag-ckp-photo { width: 100%; height: 105px; }
}
