:root {
  --ink: #f5f5f7;
  --muted: #94949a;
  --forest-950: #050505;
  --forest-900: #101012;
  --forest-800: #171719;
  --forest-700: #ff5a00;
  --forest-100: #2a1710;
  --forest-50: #15100d;
  --gold-700: #ff5a00;
  --gold-500: #ff6a00;
  --gold-200: #ffb07a;
  --gold-100: #24150e;
  --red: #ff5b57;
  --red-soft: #2a1414;
  --green: #36c98f;
  --green-soft: #10251d;
  --line: #2d2d31;
  --paper: #121214;
  --canvas: #080809;
  --shadow: 0 18px 60px rgba(0,0,0,.34);
  --radius: 18px;
  --fo-gradient: linear-gradient(105deg, #ff6a00 0%, #ff3d00 48%, #e31e24 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--canvas);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; color-scheme: dark; background: var(--canvas); }
body { margin: 0; min-width: 320px; color: var(--ink); background: var(--canvas); }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: #ff7b29; }
img, svg { display: block; }
[hidden] { display: none !important; }

.skip-link {
  position: fixed; left: 12px; top: -70px; z-index: 1000; padding: 10px 14px;
  border-radius: 10px; color: white; background: #ff5a00;
}
.skip-link:focus { top: 12px; }

.brand { display: inline-flex; align-items: center; gap: 11px; color: inherit; text-decoration: none; }
.brand img { width: 42px; height: 42px; }
.brand-word { display: grid; gap: 1px; }
.brand-word strong { color: #fff; font-size: 19px; font-weight: 900; letter-spacing: -.025em; }
.brand-word small { color: #77777d; font-size: 11px; letter-spacing: .04em; }

.site-header {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center;
  justify-content: space-between; gap: 20px; min-height: 72px; padding: 12px max(20px, calc((100vw - 1180px) / 2));
  color: #f5f5f7; background: rgba(5,5,5,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px);
}
.header-actions { display: flex; align-items: center; gap: 10px; }

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px;
  padding: 10px 16px; border: 1px solid transparent; border-radius: 11px;
  font-weight: 800; text-decoration: none; cursor: pointer; transition: .18s ease;
}
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .55; transform: none; }
.button.primary, .button.gold { color: white; background: var(--fo-gradient); box-shadow: 0 8px 26px rgba(255,83,0,.18); }
.button.primary:hover, .button.gold:hover { filter: brightness(1.08); }
.button.secondary { color: #f5f5f7; background: #151517; border-color: #36363a; }
.button.danger { color: #ff9692; background: #241313; border-color: #5c2927; }
.button.small { min-height: 34px; padding: 7px 11px; font-size: 13px; border-radius: 9px; }
.button.block { width: 100%; }

/* fallback para páginas institucionais antigas; a landing comercial possui estilo próprio */
.landing-hero { padding: 92px 22px; color: white; background: #050505; }
.hero-inner { width: min(1120px, 100%); margin: 0 auto; }
.eyebrow { margin: 0 0 16px; color: #ff6a00; font-size: 12px; font-weight: 850; letter-spacing: .15em; text-transform: uppercase; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.landing-section { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 80px 0; }
.section-heading { max-width: 720px; margin-bottom: 34px; }
.section-heading h2 { margin: 0 0 12px; font-size: clamp(32px, 4vw, 48px); font-weight: 850; letter-spacing: -.035em; }
.section-heading p { margin: 0; color: var(--muted); font-size: 17px; line-height: 1.65; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature-card { padding: 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--paper); }

.site-footer {
  display: flex; justify-content: space-between; gap: 20px;
  padding: 28px max(20px, calc((100vw - 1120px) / 2));
  color: #77777d; background: #050505; border-top: 1px solid #232326; font-size: 13px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 18px; }
.footer-links a { color: #c6c6ca; }

/* autenticação */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: minmax(300px,.8fr) minmax(460px,1.2fr); }
.auth-aside {
  position: relative; display: flex; flex-direction: column; justify-content: space-between; padding: 48px; color: white; overflow: hidden;
  background: radial-gradient(circle at 20% 15%, rgba(255,91,0,.20), transparent 26%), radial-gradient(circle at 90% 80%, rgba(227,30,36,.12), transparent 31%), #050505;
}
.auth-aside::after { content: "F&O"; position: absolute; right: -45px; bottom: -30px; color: rgba(255,255,255,.035); font: 900 190px/1 Inter,sans-serif; }
.auth-aside .brand-word small { color: #77777d; }
.auth-copy { position: relative; z-index: 1; max-width: 490px; }
.auth-copy h1 { margin: 0 0 16px; font-size: clamp(38px,5vw,62px); line-height: 1.02; font-weight: 900; letter-spacing: -.045em; }
.auth-copy p { color: rgba(255,255,255,.67); font-size: 17px; line-height: 1.65; }
.auth-main { display: grid; place-items: center; padding: 42px 24px; background: #080809; }
.auth-card {
  width: min(660px,100%); padding: clamp(24px,5vw,44px); color: #f5f5f7;
  border: 1px solid #2f2f33; border-radius: 24px; background: linear-gradient(180deg,#141416,#0f0f11); box-shadow: var(--shadow);
}
.auth-card.narrow { max-width: 480px; }
.auth-card h2 { margin: 0 0 8px; font-size: 32px; font-weight: 850; letter-spacing: -.025em; }
.auth-card > p { margin: 0 0 26px; color: #9a9aa0; line-height: 1.55; }

.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 0 16px; }
.field { margin-bottom: 17px; }
.field.span-2 { grid-column: span 2; }
.field label, .field-label { display: block; margin-bottom: 7px; color: #b2b2b7; font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.field input, .field select, .field textarea, .filter-control {
  width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid #343438; border-radius: 10px;
  color: #f5f5f7; background: #0b0b0d; outline: none;
}
.field textarea { min-height: 84px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus, .filter-control:focus { border-color: #ff6500; box-shadow: 0 0 0 3px rgba(255,101,0,.14); }
.field input:disabled { color: #77777d; background: #121214; }
.field small { color: #77777d; }
.checkbox-row { display: flex; align-items: flex-start; gap: 10px; margin: 11px 0; color: #b7b7bc; font-size: 13px; line-height: 1.45; }
.checkbox-row input { width: 18px; height: 18px; margin-top: 1px; accent-color: #ff5a00; flex: 0 0 auto; }
.form-actions { display: flex; gap: 10px; margin-top: 22px; }
.form-note { margin-top: 20px; color: var(--muted); font-size: 13px; text-align: center; }
.form-message { margin: 12px 0; padding: 11px 13px; border-radius: 10px; font-size: 13px; line-height: 1.45; }
.form-message.error { color: #ffaaa6; background: #271313; border: 1px solid #5a2725; }
.form-message.success { color: #75deb6; background: #10251d; border: 1px solid #244d3d; }
.system-warning { padding: 12px 14px; border: 1px solid #5e3317; border-radius: 11px; color: #ffc18c; background: #21150d; font-size: 13px; line-height: 1.5; }

/* aplicativo e administração */
.app-shell { min-height: 100vh; display: grid; grid-template-columns: 260px minmax(0,1fr); }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; padding: 22px 16px; color: white;
  background: radial-gradient(circle at 10% 0%, rgba(255,91,0,.10), transparent 24%), #050505; border-right: 1px solid #232326;
}
.sidebar .brand { padding: 4px 9px 22px; border-bottom: 1px solid #232326; }
.sidebar .brand-word small { color: #77777d; }
.sidebar-nav { display: grid; gap: 8px; margin-top: 22px; }
.nav-button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 13px; border: 1px solid transparent; border-radius: 10px; color: #8d8d93; background: transparent; text-align: left; cursor: pointer; }
.nav-button:hover { color: white; background: #121214; border-color: #252529; }
.nav-button.active { color: white; background: linear-gradient(90deg,rgba(255,90,0,.17),rgba(227,30,36,.07)); border-color: rgba(255,90,0,.28); }
.nav-icon { width: 23px; color: #ff6500; text-align: center; }
.sidebar-footer { margin-top: auto; padding: 18px 8px 0; border-top: 1px solid #232326; }
.sidebar-user { margin-bottom: 13px; }
.sidebar-user strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user small { color: #77777d; }
.sidebar .button.secondary { width: 100%; }

.app-main { min-width: 0; padding: 26px clamp(18px,3vw,40px) 60px; background: radial-gradient(circle at 78% 0%,rgba(255,91,0,.05),transparent 24%),#080809; }
.mobile-topbar { display: none; }
.view { display: none; animation: fade .18s ease; }
.view.active { display: block; }
@keyframes fade { from { opacity: .5; transform: translateY(4px); } }
.page-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 18px; margin-bottom: 24px; }
.page-heading h1 { margin: 0 0 6px; font-size: clamp(30px,4vw,44px); font-weight: 900; letter-spacing: -.04em; }
.page-heading p { margin: 0; color: #8d8d93; }
.kicker { color: #ff6500; font-size: 11px; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; }

.metrics-grid { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 14px; margin-bottom: 18px; }
.metric-card { position: relative; overflow: hidden; min-height: 132px; padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg,#141416,#101012); box-shadow: 0 12px 34px rgba(0,0,0,.17); }
.metric-card::after { content: ""; position: absolute; right: -24px; bottom: -34px; width: 90px; height: 90px; border-radius: 50%; background: radial-gradient(circle,rgba(255,101,0,.12),transparent 65%); }
.metric-card span { color: #909096; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; }
.metric-card strong { position: relative; z-index: 1; display: block; margin: 14px 0 4px; font-size: 34px; font-weight: 850; letter-spacing: -.035em; }
.metric-card small { color: #8d8d93; }
.content-grid { display: grid; grid-template-columns: minmax(0,1.3fr) minmax(280px,.7fr); gap: 18px; }
.content-grid.equal { grid-template-columns: repeat(2,minmax(0,1fr)); }
.card { min-width: 0; padding: 22px; color: #f5f5f7; border: 1px solid var(--line); border-radius: 16px; background: linear-gradient(180deg,#141416,#101012); box-shadow: 0 12px 34px rgba(0,0,0,.15); }
.card + .card { margin-top: 0; }
.performance-history-card { margin-top: 18px; }
.card-header { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 18px; }
.card-header h2, .card h2 { margin: 0; font-size: 22px; font-weight: 800; letter-spacing: -.02em; }
.card-header p { margin: 4px 0 0; color: #8f8f95; font-size: 13px; }
.stack { display: grid; gap: 14px; }
.empty-state { padding: 34px 18px; border: 1px dashed #343438; border-radius: 12px; color: #94949a; text-align: center; background: #101012; }

.performance-list { display: grid; gap: 13px; }
.performance-row { display: grid; grid-template-columns: minmax(150px,1fr) 2fr 58px; gap: 12px; align-items: center; }
.performance-row .label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: #dddde1; font-size: 13px; }
.bar { height: 9px; overflow: hidden; border-radius: 99px; background: #2a2a2e; }
.bar > span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg,#ff6a00,#e31e24); }
.performance-row strong { color: #dddde1; font-size: 13px; text-align: right; }

.table-wrap { overflow: auto; border: 1px solid #303034; border-radius: 12px; }
.data-table { width: 100%; border-collapse: collapse; min-width: 680px; }
.data-table th { padding: 11px 13px; color: #a2a2a8; background: #101012; font-size: 11px; letter-spacing: .05em; text-align: left; text-transform: uppercase; }
.data-table td { padding: 12px 13px; border-top: 1px solid #29292d; font-size: 13px; vertical-align: middle; }
.data-table tbody tr:hover { background: #151517; }
.rank-number { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: #ff8d46; background: #28170e; font-weight: 850; }
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 999px; color: #ff9860; background: #29170f; font-size: 11px; font-weight: 800; }
.badge.inactive { color: #ff9692; background: #2a1414; }
.badge.gold { color: #ffad73; background: #28170e; }

.question-card { padding: clamp(18px,3vw,30px); border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg,#141416,#101012); }
.question-meta { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 18px; }
.question-text { white-space: pre-wrap; color: #f0f0f2; font-size: clamp(17px,2vw,20px); line-height: 1.65; }
.alternatives { display: grid; gap: 10px; margin-top: 22px; }
.alternative { display: grid; grid-template-columns: 36px 1fr; align-items: start; gap: 11px; width: 100%; padding: 13px; border: 1px solid #343438; border-radius: 12px; color: #e9e9ec; background: #0c0c0e; text-align: left; cursor: pointer; }
.alternative:hover:not(:disabled) { border-color: #ff6500; background: #1b120d; }
.alternative:disabled { cursor: default; opacity: .72; }
.alternative.correct { color: #dffbed; border-color: #2b8a63; background: #10251d; }
.alternative.wrong { color: #ffe2df; border-color: #8b3c39; background: #2a1414; }
.letter { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: #ff8c45; background: #25150e; font-weight: 900; }
.answer-feedback { margin-top: 14px; padding: 13px 15px; border-radius: 11px; line-height: 1.5; }
.answer-feedback.correct { color: #91e6c5; background: #10251d; }
.answer-feedback.wrong { color: #ffaaa6; background: #2a1414; }
.answer-feedback.detailed { display: grid; gap: 0; padding: 20px; color: var(--ink); }
.feedback-result { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 18px; padding-bottom: 14px; }
.feedback-result strong { color: #fff; font-size: 17px; }
.feedback-result span { color: var(--muted); font-size: 12px; }
.feedback-block { padding: 14px 0; border-top: 1px solid #303034; }
.feedback-block h3 { margin: 0 0 5px; color: #ff8d46; font-size: 13px; letter-spacing: .02em; }
.feedback-block p { margin: 0; white-space: pre-wrap; line-height: 1.65; }
.feedback-block.selected-error h3 { color: var(--red); }
.feedback-block.recurrence { margin-top: 7px; padding: 14px; border: 1px solid #5e3317; border-radius: 10px; background: #21150d; }
.feedback-distractors { padding: 14px 0; border-top: 1px solid #303034; }
.feedback-distractors summary { color: #ff9860; font-weight: 800; cursor: pointer; }
.question-toolbar { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin-bottom: 18px; }
.question-toolbar .field { flex: 1 1 270px; margin: 0; }
.practice-filters { display: grid; grid-template-columns: repeat(3,minmax(180px,1fr)); gap: 12px; margin-bottom: 12px; }
.practice-filters .field { margin: 0; }

.simulation-choices { display: grid; grid-template-columns: repeat(2,1fr); gap: 16px; }
.simulation-choice { padding: 22px; border: 1px solid var(--line); border-radius: 15px; background: linear-gradient(180deg,#141416,#101012); }
.simulation-choice h3 { margin: 0 0 7px; font-size: 22px; font-weight: 800; }
.simulation-choice p { min-height: 44px; margin: 0 0 18px; color: #8f8f95; line-height: 1.55; }
.area-picker { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 7px; max-height: 270px; padding: 10px; overflow: auto; border: 1px solid #303034; border-radius: 10px; background: #0d0d0f; }
.area-option { display: flex; align-items: flex-start; gap: 8px; padding: 8px; border-radius: 8px; color: #d8d8dc; background: #151517; font-size: 12px; line-height: 1.35; }
.area-option input { margin-top: 2px; accent-color: #ff5a00; }
.simulation-progress { margin-bottom: 18px; }
.simulation-progress-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 7px; color: var(--muted); font-size: 12px; }

.filters { display: grid; grid-template-columns: minmax(220px,1fr) 180px 150px; gap: 10px; margin-bottom: 15px; }
.dimension-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 18px; margin-top: 18px; }
.student-name { font-weight: 750; }
.student-email { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }

/* piloto */
.pilot-banner { color: #ffc18c !important; background: #21150d !important; border-color: #5e3317 !important; }
.pilot-invite { color: #f5f5f7 !important; background: #111113 !important; border-color: #303034 !important; }
.pilot-link { color: #f5f5f7; background: #09090b; border-color: #343438 !important; }
.pilot-participant { border-top-color: #2b2b2f !important; }

/* diálogos */
dialog { width: min(760px,calc(100% - 30px)); max-height: 88vh; padding: 0; border: 1px solid #303034; border-radius: 18px; color: #f5f5f7; background: #111113; box-shadow: 0 24px 80px rgba(0,0,0,.5); }
dialog::backdrop { background: rgba(0,0,0,.78); backdrop-filter: blur(3px); }
.dialog-head { position: sticky; top: 0; display: flex; justify-content: space-between; align-items: center; gap: 20px; padding: 18px 22px; border-bottom: 1px solid #303034; background: #111113; }
.dialog-head h2 { margin: 0; font-weight: 800; }
.dialog-body { padding: 22px; overflow: auto; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; border: 1px solid #35353a; border-radius: 10px; color: #fff; background: #18181a; cursor: pointer; }
.details-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; margin-bottom: 20px; }
.detail { padding: 11px; border-radius: 10px; background: #18181a; }
.detail span { display: block; color: var(--muted); font-size: 11px; text-transform: uppercase; }
.detail strong { display: block; margin-top: 5px; font-size: 13px; }

/* páginas legais */
.legal-page { width: min(850px,calc(100% - 36px)); margin: 42px auto 80px; padding: clamp(24px,5vw,50px); border: 1px solid #303034; border-radius: 20px; color: #f5f5f7; background: #111113; box-shadow: var(--shadow); }
.legal-page h1 { font-size: clamp(32px,5vw,48px); font-weight: 850; letter-spacing: -.03em; }
.legal-page h2 { margin-top: 32px; font-weight: 800; }
.legal-page p, .legal-page li { color: #b1b1b6; line-height: 1.75; }
.legal-status { padding: 12px; border-left: 4px solid #ff6500; color: #ffc18c !important; background: #21150d; }

.toast-region { position: fixed; right: 18px; bottom: 18px; z-index: 100; display: grid; gap: 8px; width: min(360px,calc(100% - 36px)); }
.toast { padding: 13px 15px; border: 1px solid #35353a; border-radius: 11px; color: white; background: #18181b; box-shadow: var(--shadow); animation: toast-in .2s ease; }
.toast.error { background: #551f1d; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 980px) {
  .feature-grid { grid-template-columns: 1fr; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-aside { min-height: 290px; padding: 30px; }
  .auth-aside .auth-copy h1 { font-size: 40px; }
  .auth-aside .auth-copy p { font-size: 15px; }
  .metrics-grid { grid-template-columns: repeat(2,1fr); }
  .content-grid, .content-grid.equal { grid-template-columns: 1fr; }
  .simulation-choices { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  .site-header { min-height: 64px; padding: 10px 16px; }
  .site-header .brand-word small { display: none; }
  .site-header .button.secondary { display: none; }
  .site-footer { flex-direction: column; }
  .form-grid { grid-template-columns: 1fr; }
  .field.span-2 { grid-column: auto; }
  .app-shell { display: block; }
  .sidebar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 40; width: auto; height: 69px; padding: 7px 8px calc(7px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid #252529; }
  .sidebar > .brand, .sidebar-footer { display: none; }
  .sidebar-nav { grid-template-columns: repeat(5,1fr); gap: 2px; margin: 0; }
  .nav-button { display: grid; place-items: center; gap: 1px; padding: 5px 2px; font-size: 9px; text-align: center; }
  .nav-icon { width: auto; font-size: 17px; }
  .app-main { padding: 18px 14px 100px; }
  .mobile-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; padding-bottom: 12px; border-bottom: 1px solid #232326; }
  .mobile-topbar .brand img { width: 35px; height: 35px; }
  .mobile-topbar .brand-word small { display: none; }
  .page-heading { align-items: flex-start; }
  .metrics-grid { grid-template-columns: 1fr 1fr; gap: 9px; }
  .metric-card { min-height: 112px; padding: 15px; }
  .metric-card strong { font-size: 28px; }
  .card { padding: 16px; }
  .performance-row { grid-template-columns: minmax(100px,1fr) 1fr 48px; gap: 8px; }
  .filters { grid-template-columns: 1fr; }
  .practice-filters, .dimension-grid { grid-template-columns: 1fr; }
  .area-picker { grid-template-columns: 1fr; }
  .details-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .brand-word strong { font-size: 16px; }
  .header-actions .button { padding-inline: 11px; font-size: 13px; }
  .auth-main { padding: 18px 12px; }
  .auth-card { padding: 22px 17px; border-radius: 18px; }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric-card { min-height: 100px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
