/* =====================================================================
   Avaliação Física - Frontend do participante (mobile first)
   Cores da marca definidas em :root pelo layout (configuráveis no admin)
   ===================================================================== */
:root {
    --brand: #0f766e;
    --brand-dark: #0b5952;
    --brand-light: #e7f3f2;
    --accent: #f59e0b;
    --ink: #0f172a;
    --muted: #64748b;
    --line: #e2e8f0;
    --bg: #f4f6fb;
    --radius: 20px;
    --shadow: 0 10px 40px rgba(15, 23, 42, .08);
}

body.fe {
    font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--brand); }

.btn { font-weight: 700; letter-spacing: .01em; }
.btn-lg { padding: .85rem 1.4rem; border-radius: 14px; font-size: 1rem; }
.btn-primary { --bs-btn-bg: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand-dark); --bs-btn-hover-border-color: var(--brand-dark); --bs-btn-active-bg: var(--brand-dark); --bs-btn-disabled-bg: var(--brand); --bs-btn-disabled-border-color: var(--brand); }
.btn-outline-primary { --bs-btn-color: var(--brand); --bs-btn-border-color: var(--brand); --bs-btn-hover-bg: var(--brand); --bs-btn-hover-border-color: var(--brand); --bs-btn-active-bg: var(--brand); }
.btn-accent { background: var(--accent); color: #111; border: 0; box-shadow: 0 10px 30px rgba(0, 0, 0, .2); }
.btn-accent:hover { filter: brightness(1.05); transform: translateY(-1px); color: #111; }
.form-control, .form-select { border-radius: 12px; border-color: var(--line); }
.form-control:focus, .form-select:focus, .form-check-input:focus { border-color: var(--brand); box-shadow: 0 0 0 .25rem color-mix(in srgb, var(--brand) 18%, transparent); }
.form-check-input:checked { background-color: var(--brand); border-color: var(--brand); }
.req { color: #dc2626; font-weight: 700; }

/* ---------- Marca ---------- */
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--ink); font-weight: 800; }
.brand-light { color: #fff; }
.brand-logo { max-height: 40px; max-width: 160px; object-fit: contain; }
.brand-logo-lg { max-height: 64px; max-width: 200px; }
.brand-mark { width: 40px; height: 40px; border-radius: 12px; background: var(--brand); color: #fff; display: inline-grid; place-items: center; font-weight: 800; font-size: .95rem; flex-shrink: 0; }
.brand-mark-lg { width: 64px; height: 64px; border-radius: 18px; font-size: 1.4rem; }
.brand-name { font-size: 1rem; }

/* ---------- Home ---------- */
.fe-home { background: #0b1220; }
.home-hero { position: relative; min-height: calc(100vh - 70px); color: #fff; overflow: hidden; display: flex; align-items: center; padding: 24px 0 48px; }
.home-hero::before { content: ''; position: absolute; inset: 0; background: radial-gradient(1200px 600px at 10% 10%, color-mix(in srgb, var(--brand) 70%, transparent), transparent 60%), linear-gradient(135deg, var(--brand-dark), #0b1220 70%); }
.home-hero-bg { position: absolute; inset: 0; background-size: cover; background-position: center; opacity: .25; mix-blend-mode: luminosity; }
.home-nav { display: flex; justify-content: space-between; align-items: center; margin-bottom: 32px; }
.home-nav .brand-mark { background: rgba(255, 255, 255, .15); backdrop-filter: blur(6px); }
.home-nav .brand-name { color: #fff; }
.home-chip { display: inline-flex; gap: .4rem; align-items: center; padding: .4rem .9rem; border-radius: 99px; background: rgba(255, 255, 255, .12); font-size: .85rem; font-weight: 600; margin-bottom: 1.2rem; }
.home-title { font-size: clamp(2rem, 6vw, 3.6rem); font-weight: 800; line-height: 1.08; letter-spacing: -.02em; }
.home-text { font-size: 1.1rem; opacity: .85; max-width: 580px; margin: 1.2rem 0 2rem; line-height: 1.6; }
.home-cta { padding: 1.05rem 2rem; border-radius: 16px; font-size: 1.05rem; width: 100%; max-width: 360px; }
.home-meta { display: flex; flex-wrap: wrap; gap: 1rem 1.5rem; margin-top: 1.6rem; font-size: .9rem; opacity: .8; }
.home-pro-card { display: flex; gap: 1rem; align-items: center; background: #fff; color: var(--ink); border-radius: var(--radius); padding: 1.2rem; box-shadow: var(--shadow); }
.home-steps { margin-top: 1rem; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--radius); padding: 1.2rem 1.4rem; backdrop-filter: blur(8px); }
.home-steps ol { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; }
.home-steps li { display: flex; align-items: center; gap: .6rem; font-weight: 600; }
.home-steps .num { font-size: .75rem; opacity: .6; width: 22px; }
.fe-home .fe-footer { background: #0b1220; color: rgba(255, 255, 255, .6); }
.fe-home .fe-footer a { color: rgba(255, 255, 255, .8); }

/* ---------- Card da etapa ---------- */
.fe-main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 16px 12px 32px; }
.fe-card { background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 18px 24px; position: relative; }
@media (min-width: 768px) {
    .fe-main { padding: 40px 16px 56px; }
    .fe-card { padding: 36px 44px 40px; }
}
.fe-topbar { display: flex; justify-content: space-between; align-items: center; padding-bottom: 14px; margin-bottom: 14px; border-bottom: 1px solid var(--line); }
.fe-topbar-title { font-size: .75rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: var(--muted); }
.progress-wrap { position: sticky; top: 0; z-index: 5; background: #fff; padding: 8px 0 6px; margin-bottom: 18px; }
.progress { height: 10px; border-radius: 99px; background: #eef2f7; }
.progress-bar { background: linear-gradient(90deg, var(--brand), var(--accent)); border-radius: 99px; transition: width .6s ease; }
.step-dots { display: flex; gap: 4px; list-style: none; padding: 0; margin: 8px 0 0; }
.step-dots li { flex: 1; height: 4px; border-radius: 4px; background: #e8edf4; }
.step-dots li.done { background: color-mix(in srgb, var(--brand) 55%, #fff); }
.step-dots li.current { background: var(--brand); }
.step-head { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 18px; }
.step-icon { width: 52px; height: 52px; border-radius: 16px; background: color-mix(in srgb, var(--step-color) 12%, #fff); color: var(--step-color); display: grid; place-items: center; font-size: 1.5rem; flex-shrink: 0; }
.step-kicker { font-size: .72rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; color: var(--step-color); }
.step-title { font-size: 1.55rem; font-weight: 800; margin: 0; letter-spacing: -.01em; }
.step-desc { color: var(--muted); margin: .25rem 0 0; }

/* ---------- Perguntas ---------- */
.q-list { display: grid; gap: 14px; }
.q-block { border: 1px solid var(--line); border-radius: 16px; padding: 18px 16px; background: #fff; transition: border-color .2s, box-shadow .2s; }
.q-block:focus-within { border-color: color-mix(in srgb, var(--brand) 50%, #fff); box-shadow: 0 6px 24px rgba(15, 23, 42, .06); }
.q-block.has-error { border-color: #fca5a5; background: #fffafa; }
.q-block.is-hidden, .q-block.page-hidden { display: none; }
.q-block.reveal { animation: reveal .35s ease; }
.q-block.slide-in { animation: slideIn .3s ease; }
.q-eyebrow { font-size: .72rem; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; color: var(--brand); margin-bottom: 6px; }
.q-eyebrow.repeat { display: none; }
.mode-one .q-eyebrow.repeat { display: block; }
.q-title { display: block; font-weight: 700; font-size: 1.08rem; margin-bottom: 4px; line-height: 1.35; }
.q-help { color: var(--muted); font-size: .9rem; margin-bottom: 10px; }
.q-title + .choices, .q-title + .scale, .q-title + input, .q-title + textarea, .q-title + select, .q-title + .input-group { margin-top: 10px; }
.q-error { color: #dc2626; font-size: .88rem; font-weight: 600; margin-top: 8px; }
.q-error:empty { display: none; }
.mode-one .q-block { border: 0; padding: 8px 0; min-height: 180px; }
.q-pager { margin-top: 8px; font-weight: 600; }

.choices { display: grid; gap: 10px; }
.choices-inline { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
.choice { position: relative; cursor: pointer; margin: 0; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice-box { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 12px 16px; border: 2px solid var(--line); border-radius: 14px; font-weight: 600; transition: all .15s; background: #fff; user-select: none; }
.choice-box:hover { border-color: color-mix(in srgb, var(--brand) 40%, #fff); }
.choice-mark { width: 22px; height: 22px; border: 2px solid #cbd5e1; border-radius: 50%; flex-shrink: 0; position: relative; transition: all .15s; }
.choice input[type=checkbox] + .choice-box .choice-mark { border-radius: 7px; }
.choice input:checked + .choice-box { border-color: var(--brand); background: var(--brand-light); color: var(--brand-dark); }
.choice input:checked + .choice-box .choice-mark { border-color: var(--brand); background: var(--brand); }
.choice input:checked + .choice-box .choice-mark::after { content: ''; position: absolute; left: 6px; top: 2px; width: 6px; height: 11px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.choice input:focus-visible + .choice-box { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.choices-inline .choice-box { justify-content: center; }

.scale { display: grid; grid-template-columns: repeat(auto-fit, minmax(40px, 1fr)); gap: 6px; }
.scale-item { margin: 0; cursor: pointer; }
.scale-item input { position: absolute; opacity: 0; pointer-events: none; }
.scale-item span { display: grid; place-items: center; height: 48px; border: 2px solid var(--line); border-radius: 12px; font-weight: 700; transition: all .15s; }
.scale-item input:checked + span { background: var(--brand); border-color: var(--brand); color: #fff; transform: scale(1.06); }
.scale-item input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--brand) 35%, transparent); }
.scale-labels { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); margin-top: 6px; }

.file-drop { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px; border: 2px dashed #cbd5e1; border-radius: 16px; text-align: center; cursor: pointer; color: var(--muted); transition: all .2s; margin: 0; }
.file-drop i { font-size: 1.8rem; color: var(--brand); }
.file-drop:hover, .file-drop.has-file { border-color: var(--brand); background: var(--brand-light); color: var(--brand-dark); }
.file-drop-text { font-weight: 700; color: var(--ink); }
.file-drop-sm { flex-direction: row; justify-content: center; padding: 12px; }
.file-drop-sm i { font-size: 1.2rem; }
.file-current { display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: #f8fafc; border-radius: 12px; margin-bottom: 8px; font-size: .92rem; }

/* ---------- Boas-vindas ---------- */
.welcome-pro { display: flex; gap: 14px; align-items: center; padding: 14px; background: var(--brand-light); border-radius: 16px; margin-bottom: 18px; }
.welcome-content { line-height: 1.7; color: #334155; white-space: normal; }
.consent-box { display: flex; gap: 12px; align-items: flex-start; padding: 16px; border: 2px solid var(--line); border-radius: 16px; cursor: pointer; font-weight: 600; }
.consent-box .form-check-input { width: 1.5em; height: 1.5em; margin-top: 0; flex-shrink: 0; }
.consent-box.has-error { border-color: #fca5a5; }
.consent-box:has(input:checked) { border-color: var(--brand); background: var(--brand-light); }

/* ---------- Ações ---------- */
.fe-actions { display: flex; gap: 10px; margin-top: 24px; position: sticky; bottom: 0; background: linear-gradient(transparent, #fff 30%); padding: 18px 0 4px; z-index: 4; }
.fe-actions .btn-continue { flex: 1; }
@media (min-width: 768px) {
    .fe-actions { position: static; justify-content: space-between; background: none; padding-top: 8px; }
    .fe-actions .btn-continue { flex: 0 0 auto; min-width: 240px; }
}

.link-notice { background: #fffbeb; border: 1px solid #fde68a; border-radius: 16px; padding: 14px; margin-bottom: 16px; color: #78350f; }
.autosave-status { color: var(--muted); }
.empty-state { text-align: center; padding: 32px 12px; color: var(--muted); }
.empty-state i { font-size: 2.2rem; }

/* ---------- Revisão ---------- */
.review-code { display: flex; gap: 8px; align-items: center; padding: 10px 14px; background: #f8fafc; border-radius: 12px; font-size: .92rem; margin-bottom: 16px; width: fit-content; }
.review-section { border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin-bottom: 14px; }
.review-section header { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 10px; }
.review-section h2 { font-size: 1.1rem; font-weight: 800; margin: 0; }
.review-list { margin: 0; }
.review-row { display: grid; gap: 2px; padding: 10px 0; border-top: 1px dashed var(--line); }
.review-row:first-child { border-top: 0; }
.review-row dt { font-weight: 600; font-size: .85rem; color: var(--muted); }
.review-row dd { margin: 0; font-weight: 600; }
@media (min-width: 768px) { .review-row { grid-template-columns: 45% 1fr; gap: 16px; } }

/* ---------- Conclusão ---------- */
.done-card { padding-top: 48px; padding-bottom: 48px; overflow: hidden; }
.done-icon { width: 88px; height: 88px; border-radius: 50%; margin: 0 auto; display: grid; place-items: center; font-size: 2.6rem; color: #fff; background: linear-gradient(135deg, var(--brand), var(--accent)); box-shadow: 0 16px 40px color-mix(in srgb, var(--brand) 35%, transparent); animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
.done-icon-sm { width: 64px; height: 64px; font-size: 1.8rem; }
.done-pro { display: inline-flex; gap: 14px; align-items: center; padding: 14px 18px; background: #f8fafc; border-radius: 16px; }
.confetti { position: absolute; inset: 0; pointer-events: none; background-image: radial-gradient(circle, var(--accent) 3px, transparent 4px), radial-gradient(circle, var(--brand) 3px, transparent 4px); background-size: 90px 90px, 130px 130px; background-position: 0 0, 40px 60px; opacity: .15; animation: drift 12s linear infinite; }

/* ---------- Rodapé ---------- */
.fe-footer { text-align: center; font-size: .82rem; color: var(--muted); padding: 18px 12px 24px; display: grid; gap: 6px; }
.fe-footer a { color: var(--muted); text-decoration: none; }
.fe-footer a:hover { text-decoration: underline; }

/* ---------- Animações ---------- */
.fade-up { animation: fadeUp .5s ease both; }
.delay-1 { animation-delay: .12s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes reveal { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@keyframes slideIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
@keyframes drift { from { background-position: 0 0, 40px 60px; } to { background-position: 0 360px, 40px 580px; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
