/* =====================================================================
   FinoraCred — Design System
   Fintech premium brasileira: limpo, moderno, sofisticado, leve, confiável.
   ===================================================================== */

:root {
  --navy-950: #061733;
  --navy-900: #0b2147;
  --navy-800: #0b2a5b;
  --navy-700: #123a7a;
  --navy-600: #1d4f9e;
  --navy-100: #e6edf8;
  --navy-50: #f3f6fc;
  --orange-600: #d9860c;
  --orange-500: #f0a020;
  --orange-400: #f6b84d;
  --orange-100: #fdf0d9;
  --ink: #0b2147;
  --ink-2: #33456a;
  --ink-3: #66779a;
  --ink-4: #9aa7bf;
  --line: #e3e9f3;
  --line-2: #eef2f8;
  --bg: #f6f8fc;
  --surface: #ffffff;
  --success: #16a34a;
  --success-bg: #e8f7ee;
  --warning: #c97a00;
  --warning-bg: #fff4dd;
  --danger: #d33a3a;
  --danger-bg: #fdecec;
  --info: #1d4f9e;
  --info-bg: #e9f0fb;
  --radius-sm: 10px;
  --radius: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 1px 2px rgba(11, 33, 71, .06);
  --shadow: 0 6px 24px rgba(11, 33, 71, .07);
  --shadow-lg: 0 18px 50px rgba(11, 33, 71, .14);
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --fast: 160ms;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --sidebar: 260px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 15px; line-height: 1.5; color: var(--ink);
  background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--navy-700); text-decoration: none; }
a:hover { color: var(--navy-600); text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .4em; line-height: 1.2; color: var(--ink); letter-spacing: -.01em; }
h1 { font-size: clamp(1.6rem, 2.4vw, 2.1rem); font-weight: 800; }
h2 { font-size: 1.35rem; font-weight: 750; }
h3 { font-size: 1.08rem; font-weight: 700; }
p { margin: 0 0 1em; color: var(--ink-2); }
small, .muted { color: var(--ink-3); }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }
:focus-visible { outline: 3px solid var(--orange-400); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- Marca */
.brand { display: inline-flex; align-items: center; }
.brand-logo {
  display: block; width: 168px; aspect-ratio: 10 / 3;
  background: url("../img/logo.png") 50% 54.5% / 113.4% auto no-repeat;
}
.brand-logo.sm { width: 132px; }
.brand-logo.lg { width: 220px; }
.brand-mark { font-weight: 800; font-size: 1.25rem; color: var(--navy-800); letter-spacing: .02em; }
.brand-mark span { color: var(--orange-500); }

/* ---------------------------------------------------------------- Botões */
.btn {
  --b: var(--navy-800); --c: #fff;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 46px; padding: 0 20px; border-radius: 12px; border: 1px solid transparent;
  background: var(--b); color: var(--c); font: inherit; font-weight: 650; cursor: pointer;
  transition: transform var(--fast) var(--ease), box-shadow var(--fast) var(--ease), background var(--fast);
  text-decoration: none; white-space: nowrap; user-select: none;
}
.btn:hover { text-decoration: none; color: var(--c); box-shadow: var(--shadow); transform: translateY(-1px); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn[disabled], .btn.is-loading { opacity: .6; pointer-events: none; }
.btn-accent { --b: var(--orange-500); --c: var(--navy-950); }
.btn-accent:hover { background: var(--orange-400); }
.btn-outline { --b: transparent; --c: var(--navy-800); border-color: var(--line); background: var(--surface); }
.btn-ghost { --b: transparent; --c: var(--navy-800); }
.btn-ghost:hover { background: var(--navy-50); box-shadow: none; }
.btn-danger { --b: var(--danger); }
.btn-success { --b: var(--success); }
.btn-lg { min-height: 56px; padding: 0 28px; font-size: 1.05rem; border-radius: 14px; }
.btn-sm { min-height: 36px; padding: 0 14px; font-size: .88rem; border-radius: 10px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; min-height: 40px; padding: 0; }
.btn.is-loading::after {
  content: ""; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent;
  border-radius: 50%; animation: spin .7s linear infinite;
}

/* ---------------------------------------------------------------- Formulários */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-size: .86rem; font-weight: 650; color: var(--ink-2); }
.field .hint { font-size: .8rem; color: var(--ink-3); }
.field .error { font-size: .82rem; color: var(--danger); font-weight: 550; }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 0 16px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--surface); color: var(--ink); font: inherit; font-size: 1rem;
  transition: border-color var(--fast), box-shadow var(--fast);
}
.textarea { padding: 12px 16px; min-height: 110px; resize: vertical; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 22px) 50%, calc(100% - 16px) 50%; background-size: 6px 6px; background-repeat: no-repeat; padding-right: 40px; }
.input:hover, .select:hover { border-color: #cfd8e8; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--navy-600); box-shadow: 0 0 0 4px rgba(29, 79, 158, .12); }
.field.has-error .input, .field.has-error .select { border-color: var(--danger); }
.input-lg { min-height: 60px; font-size: 1.2rem; font-weight: 650; }
.input-money { font-variant-numeric: tabular-nums; }
.input-group { position: relative; }
.input-group .prefix { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--ink-3); font-weight: 650; pointer-events: none; }
.input-group .input { padding-left: 46px; }
.input-group .suffix-btn { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--ink-2); cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--navy-800); flex: none; }
.otp-input { letter-spacing: .5em; text-align: center; font-size: 1.6rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.form-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 0 16px; }
.form-grid > * { grid-column: span 12; }
@media (min-width: 720px) {
  .col-6 { grid-column: span 6 !important; } .col-4 { grid-column: span 4 !important; }
  .col-3 { grid-column: span 3 !important; } .col-8 { grid-column: span 8 !important; } .col-9 { grid-column: span 9 !important; }
  .col-2 { grid-column: span 2 !important; } .col-5 { grid-column: span 5 !important; } .col-7 { grid-column: span 7 !important; } .col-10 { grid-column: span 10 !important; }
}

/* ---------------------------------------------------------------- Cards */
.card { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm); padding: 24px; }
.card + .card { margin-top: 16px; }
.card-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.card-header h2, .card-header h3 { margin: 0; }
.card-flush { padding: 0; overflow: hidden; }
.card-flush .card-header { padding: 20px 24px 0; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 16px; margin-bottom: 20px; }
.kpi { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px 20px; box-shadow: var(--shadow-sm); }
.kpi .kpi-label { font-size: .8rem; color: var(--ink-3); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.kpi .kpi-value { font-size: 1.55rem; font-weight: 800; color: var(--navy-900); margin-top: 6px; font-variant-numeric: tabular-nums; }
.kpi .kpi-sub { font-size: .82rem; color: var(--ink-3); margin-top: 2px; }
.kpi.accent { background: linear-gradient(135deg, var(--navy-800), var(--navy-700)); border: 0; }
.kpi.accent .kpi-label, .kpi.accent .kpi-sub { color: #c9d6ee; }
.kpi.accent .kpi-value { color: #fff; }

.grid { display: grid; gap: 20px; }
@media (min-width: 980px) {
  .grid-2 { grid-template-columns: 1fr 1fr; }
  .grid-3-1 { grid-template-columns: 2fr 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr 1fr; }
  .grid-1-2 { grid-template-columns: 1fr 2fr; }
}

/* ---------------------------------------------------------------- Tabelas */
.table-wrap { width: 100%; max-width:100%; overflow-x: auto; container-type:inline-size; }
.panel-main, .panel-content, .grid > *, .card, #page-root { min-width:0; }
.table th { overflow-wrap:anywhere; }
.table td { overflow-wrap:anywhere; }
.table .btn { white-space:normal; }
.table .num, .table .nowrap { white-space:normal; }
.table .select { max-width:100%; min-width:0; }
.bordero-brands { display:flex; gap:24px; align-items:center; flex-wrap:wrap; }
.bordero-brands img { max-width:160px; max-height:64px; object-fit:contain; }
.finora-document-logo { position:relative; width:132px; aspect-ratio:10/3; overflow:hidden; flex-shrink:0; }
.bordero-brands .finora-document-logo img { position:absolute; width:113.4%; max-width:none; max-height:none; top:54.5%; left:50%; transform:translate(-50%,-54.5%); }
@container (max-width: 1100px) {
  .table.table-dense thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .table.table-dense, .table.table-dense tbody { display:block; }
  .table.table-dense tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:12px; border-bottom:1px solid var(--line); }
  .table.table-dense td { display:block; padding:8px; text-align:left; border:0; white-space:normal; }
  .table.table-dense td::before { content:attr(data-label); display:block; font-size:.72rem; font-weight:650; color:var(--ink-3); margin-bottom:4px; }
}
@container (max-width: 640px) {
  .table.table-responsive thead { position:absolute; width:1px; height:1px; overflow:hidden; clip-path:inset(50%); }
  .table.table-responsive, .table.table-responsive tbody { display:block; }
  .table.table-responsive tr { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); padding:8px; border-bottom:1px solid var(--line); }
  .table.table-responsive td { display:block; padding:8px; text-align:left; border:0; white-space:normal; }
  .table.table-responsive td::before { content:attr(data-label); display:block; font-size:.72rem; font-weight:650; color:var(--ink-3); margin-bottom:4px; }
  .table.table-responsive td[colspan] { grid-column:1/-1; }
}
@media print {
  .table.table-responsive, .table.table-dense { display:table; }
  .table.table-responsive tbody, .table.table-dense tbody { display:table-row-group; }
  .table.table-responsive thead, .table.table-dense thead { position:static; display:table-header-group; width:auto; height:auto; clip-path:none; }
  .table.table-responsive tr, .table.table-dense tr { display:table-row; }
  .table.table-responsive td, .table.table-dense td { display:table-cell; }
  .table td::before { display:none!important; }
}
@container (max-width:1100px) {
  .table.table-dense thead:has(input) { position:static; width:auto; height:auto; clip-path:none; display:block; }
  .table.table-dense thead:has(input) th { display:none; }
  .table.table-dense thead:has(input) th:has(input) { display:block; }
  .table.table-dense thead th:has(input)::after { content:' Selecionar todos'; }
}
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .76rem; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); font-weight: 650; padding: 12px 16px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--fast); }
.table tbody tr.clickable { cursor: pointer; }
.table tbody tr:hover { background: var(--navy-50); }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------------------------------------------------------- Status / badges */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px; font-size: .78rem; font-weight: 650; background: var(--navy-50); color: var(--navy-700); white-space: nowrap; }
.chip::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; opacity: .85; }
.chip.success { background: var(--success-bg); color: var(--success); }
.chip.warning { background: var(--warning-bg); color: var(--warning); }
.chip.danger { background: var(--danger-bg); color: var(--danger); }
.chip.info { background: var(--info-bg); color: var(--info); }
.chip.neutral { background: #f0f2f6; color: var(--ink-3); }
.badge { display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: .74rem; font-weight: 700; background: var(--orange-100); color: var(--orange-600); }

/* ---------------------------------------------------------------- Alertas */
.alert { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius); background: var(--info-bg); color: var(--navy-800); font-size: .92rem; margin-bottom: 16px; align-items: flex-start; }
.alert strong { display: block; margin-bottom: 2px; }
.alert.success { background: var(--success-bg); color: #0f6b32; }
.alert.warning { background: var(--warning-bg); color: #7a4b00; }
.alert.danger { background: var(--danger-bg); color: #962424; }
.alert .alert-icon { flex: none; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: .8rem; background: currentColor; }
.alert .alert-icon span { color: #fff; }

/* ---------------------------------------------------------------- Toast */
.toasts { position: fixed; right: 16px; bottom: 16px; z-index: 1000; display: flex; flex-direction: column; gap: 10px; max-width: min(420px, calc(100vw - 32px)); }
.toast { background: var(--navy-900); color: #fff; padding: 14px 18px; border-radius: 14px; box-shadow: var(--shadow-lg); font-size: .92rem; animation: toast-in 220ms var(--ease); display: flex; gap: 10px; align-items: flex-start; }
.toast.success { background: #0f5132; }
.toast.error { background: #8a1f1f; }
.toast.leaving { animation: toast-out 180ms var(--ease) forwards; }

/* ---------------------------------------------------------------- Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(6, 23, 51, .45); z-index: 900; display: grid; place-items: center; padding: 16px; animation: fade-in 160ms var(--ease); }
.modal { background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-lg); width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; padding: 28px; animation: modal-in 200ms var(--ease); }
.modal h2 { margin-bottom: 8px; }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

/* ---------------------------------------------------------------- Stepper */
.stepper { display: flex; gap: 6px; margin: 0 0 24px; padding: 0; list-style: none; overflow-x: auto; }
.stepper li { flex: 1; min-width: 70px; }
.stepper .bar { height: 5px; border-radius: 4px; background: var(--line); transition: background var(--fast); }
.stepper .name { font-size: .72rem; color: var(--ink-4); margin-top: 6px; font-weight: 600; white-space: nowrap; }
.stepper li.done .bar { background: var(--navy-700); }
.stepper li.current .bar { background: var(--orange-500); }
.stepper li.current .name, .stepper li.done .name { color: var(--ink-2); }

/* ---------------------------------------------------------------- Timeline */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline li { position: relative; padding: 0 0 18px 26px; }
.timeline li::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: -4px; width: 2px; background: var(--line); }
.timeline li:last-child::before { display: none; }
.timeline li::after { content: ""; position: absolute; left: 1px; top: 4px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface); border: 3px solid var(--navy-600); }
.timeline .t-title { font-weight: 650; font-size: .92rem; }
.timeline .t-meta { font-size: .8rem; color: var(--ink-3); }

/* ---------------------------------------------------------------- Consulta às financeiras */
.providers { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.provider-card { border: 1.5px solid var(--line); border-radius: var(--radius); padding: 16px; background: var(--surface); display: flex; align-items: center; gap: 12px; transition: border-color var(--fast), background var(--fast); animation: card-in 240ms var(--ease) both; }
.provider-card .p-name { font-weight: 700; font-size: .95rem; }
.provider-card .p-state { font-size: .82rem; color: var(--ink-3); }
.provider-card .dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ink-4); flex: none; }
.provider-card.querying .dot { background: var(--orange-500); animation: pulse 1.2s ease-in-out infinite; }
.provider-card.offer { border-color: #bfe5cc; background: #f6fcf8; }
.provider-card.offer .dot { background: var(--success); }
.provider-card.no_offer .dot, .provider-card.unavailable .dot { background: var(--ink-4); }
.searching { display: flex; align-items: center; gap: 14px; padding: 18px 0; }
.searching .bar { flex: 1; height: 6px; border-radius: 6px; background: var(--line); overflow: hidden; position: relative; }
.searching .bar span { position: absolute; inset: 0; width: 40%; border-radius: 6px; background: linear-gradient(90deg, var(--navy-700), var(--orange-500)); animation: indeterminate 1.4s var(--ease) infinite; }

.offers { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.offer-card { border: 1.5px solid var(--line); border-radius: var(--radius-lg); padding: 20px; background: var(--surface); position: relative; transition: border-color var(--fast), box-shadow var(--fast), transform var(--fast); animation: card-in 260ms var(--ease) both; display: flex; flex-direction: column; }
.offer-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.offer-card.best { border-color: var(--orange-500); box-shadow: 0 0 0 3px rgba(240, 160, 32, .15); }
.offer-card .tag { position: absolute; top: -11px; left: 18px; background: var(--orange-500); color: var(--navy-950); font-size: .72rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.offer-card .o-provider { font-size: .85rem; color: var(--ink-3); font-weight: 650; }
.offer-card .o-installment { font-size: 1.7rem; font-weight: 800; color: var(--navy-900); margin: 8px 0 2px; font-variant-numeric: tabular-nums; }
.offer-card .o-installment small { font-size: .95rem; color: var(--ink-3); font-weight: 650; }
.offer-card dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; font-size: .86rem; margin: 14px 0 18px; }
.offer-card dt { color: var(--ink-3); }
.offer-card dd { margin: 0; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.offer-card .btn { margin-top: auto; }

/* ---------------------------------------------------------------- Estados */
.empty { text-align: center; padding: 48px 20px; color: var(--ink-3); }
.empty .empty-icon { width: 56px; height: 56px; border-radius: 16px; background: var(--navy-50); margin: 0 auto 14px; display: grid; place-items: center; font-size: 1.5rem; color: var(--navy-700); }
.skeleton { background: linear-gradient(90deg, #eef2f8 25%, #f7f9fc 37%, #eef2f8 63%); background-size: 400% 100%; animation: shimmer 1.4s ease infinite; border-radius: 8px; min-height: 14px; }
.success-check { width: 72px; height: 72px; border-radius: 50%; background: var(--success-bg); color: var(--success); display: grid; place-items: center; margin: 0 auto 16px; animation: pop 420ms cubic-bezier(.34, 1.56, .64, 1); }
.success-check svg { width: 36px; height: 36px; }
.spinner { width: 22px; height: 22px; border: 3px solid var(--line); border-top-color: var(--navy-700); border-radius: 50%; animation: spin .8s linear infinite; }

/* ---------------------------------------------------------------- Site público */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line-2); }
.site-header .inner, .container { width: min(1180px, 100% - 32px); margin: 0 auto; }
.site-header .inner { display: flex; align-items: center; justify-content: space-between; min-height: 72px; gap: 20px; }
.site-nav { display: flex; gap: 6px; align-items: center; }
.site-nav a { color: var(--ink-2); font-weight: 600; padding: 8px 12px; border-radius: 10px; font-size: .94rem; }
.site-nav a:hover { background: var(--navy-50); text-decoration: none; }
/* botões dentro do menu do site mantêm as cores do botão (corrige botão "branco") */
.site-nav a.btn { color: var(--c); background: var(--b); padding: 0 16px; }
.site-nav a.btn:hover { color: var(--c); background: var(--b); filter: brightness(1.08); }
.site-nav a.btn-accent:hover { background: var(--orange-400); filter: none; }
.field.is-loading .input { background-image: linear-gradient(90deg, transparent, rgba(29,79,158,.08), transparent); background-size: 200% 100%; animation: shimmer 1s linear infinite; }
.site-nav .nav-links { display: flex; gap: 2px; }
@media (max-width: 900px) { .site-nav .nav-links { display: none; } }
.hero { background: radial-gradient(1200px 500px at 85% -10%, rgba(240, 160, 32, .16), transparent 60%), linear-gradient(180deg, #fff, var(--bg)); padding: 72px 0 56px; }
.hero .inner { display: grid; gap: 40px; align-items: center; }
@media (min-width: 960px) { .hero .inner { grid-template-columns: 1.1fr .9fr; } }
.hero h1 { font-size: clamp(2rem, 4.2vw, 3.2rem); line-height: 1.08; letter-spacing: -.025em; }
.hero h1 em { font-style: normal; color: var(--orange-600); }
.hero p.lead { font-size: 1.15rem; max-width: 560px; }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-visual { background: var(--surface); border-radius: 24px; box-shadow: var(--shadow-lg); padding: 24px; border: 1px solid var(--line-2); }
.section { padding: 64px 0; }
.section.alt { background: var(--surface); }
.section-title { text-align: center; max-width: 680px; margin: 0 auto 40px; }
.section-title p { font-size: 1.05rem; }
.features { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature { padding: 24px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line-2); }
.section.alt .feature { background: var(--bg); }
.feature .f-icon { width: 46px; height: 46px; border-radius: 14px; background: var(--navy-800); color: var(--orange-400); display: grid; place-items: center; font-weight: 800; margin-bottom: 14px; }
.steps-row { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); counter-reset: s; }
.steps-row .s { counter-increment: s; padding: 22px; border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--line-2); }
.steps-row .s::before { content: counter(s); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--orange-500); color: var(--navy-950); font-weight: 800; margin-bottom: 10px; }
.cta-band { background: linear-gradient(135deg, var(--navy-900), var(--navy-700)); color: #fff; border-radius: 24px; padding: 44px; display: flex; flex-wrap: wrap; gap: 20px; align-items: center; justify-content: space-between; }
.cta-band h2, .cta-band p { color: #fff; margin: 0; }
.cta-band p { color: #c9d6ee; }
.site-footer { background: var(--navy-950); color: #b7c4dd; padding: 48px 0 28px; font-size: .9rem; }
.site-footer a { color: #dce5f5; }
.site-footer .cols { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.site-footer h4 { color: #fff; font-size: .9rem; margin-bottom: 12px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.site-footer .legal { border-top: 1px solid rgba(255, 255, 255, .1); margin-top: 32px; padding-top: 20px; font-size: .8rem; color: #8193b5; }
.prose { max-width: 760px; }
.prose p, .prose li { color: var(--ink-2); font-size: 1rem; line-height: 1.7; }
.faq details { background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); padding: 18px 20px; margin-bottom: 10px; }
.faq summary { font-weight: 700; cursor: pointer; list-style: none; }
.faq summary::-webkit-details-marker { display: none; }
.faq details[open] summary { margin-bottom: 8px; }

/* ---------------------------------------------------------------- Autenticação */
.auth { min-height: 100vh; display: grid; }
@media (min-width: 960px) { .auth { grid-template-columns: 1fr 1fr; } }
.auth-side { display: none; background: radial-gradient(800px 400px at 20% 0%, rgba(240, 160, 32, .22), transparent 60%), linear-gradient(160deg, var(--navy-900), var(--navy-700)); color: #fff; padding: 56px; flex-direction: column; justify-content: space-between; }
@media (min-width: 960px) { .auth-side { display: flex; } }
.auth-side h2 { color: #fff; font-size: 2rem; line-height: 1.15; }
.auth-side p { color: #c9d6ee; font-size: 1.05rem; }
.auth-side .brand-box { background: #fff; border-radius: 16px; padding: 10px 16px; display: inline-block; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 32px 16px; background: var(--surface); }
.auth-box { width: min(440px, 100%); }
.auth-box .brand { margin-bottom: 28px; }
.auth-box h1 { font-size: 1.7rem; }
.auth-foot { margin-top: 24px; text-align: center; font-size: .92rem; color: var(--ink-3); }
.qr-box { width: 220px; margin: 12px auto; padding: 10px; border-radius: 16px; border: 1px solid var(--line); background: #fff; }
.qr-box.pulse { animation: qr-pulse 2.4s ease-in-out infinite; }
.code-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; font-family: ui-monospace, Consolas, monospace; font-size: .95rem; }
.code-list span { background: var(--navy-50); padding: 8px; border-radius: 8px; text-align: center; }
.choice-cards { display: grid; gap: 12px; }
@media (min-width: 560px) { .choice-cards { grid-template-columns: 1fr 1fr; } }
.choice { border: 2px solid var(--line); border-radius: var(--radius-lg); padding: 18px; cursor: pointer; transition: border-color var(--fast), background var(--fast); display: block; }
.choice:hover { border-color: #cbd6ea; }
.choice input { position: absolute; opacity: 0; }
.choice.selected, .choice:has(input:checked) { border-color: var(--navy-700); background: var(--navy-50); }
.choice strong { display: block; font-size: 1.02rem; margin-bottom: 4px; }
.choice span { font-size: .86rem; color: var(--ink-3); }

/* ---------------------------------------------------------------- Painéis (lojista / backoffice) */
.panel { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; width: var(--sidebar); background: var(--navy-950); color: #c1cde3; display: flex; flex-direction: column; z-index: 60; transform: translateX(-100%); transition: transform 220ms var(--ease); }
.sidebar.open { transform: none; box-shadow: var(--shadow-lg); }
@media (min-width: 1024px) { .sidebar { transform: none; } .panel-main { margin-left: var(--sidebar); } }
.sidebar .sb-brand { padding: 20px 20px 14px; }
.sidebar .sb-brand .brand-box { background: #fff; border-radius: 14px; padding: 6px 12px; display: inline-block; }
.sidebar .sb-cta { padding: 4px 16px 14px; }
.sidebar nav { flex: 1; overflow-y: auto; padding: 8px 12px 20px; }
.sidebar .nav-group { font-size: .7rem; text-transform: uppercase; letter-spacing: .08em; color: #6f82a6; margin: 18px 10px 6px; font-weight: 700; }
.sidebar nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #c1cde3; font-weight: 600; font-size: .92rem; text-decoration: none; }
.sidebar nav a:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.sidebar nav a.active { background: rgba(240, 160, 32, .14); color: var(--orange-400); }
.sidebar nav a .ico { width: 20px; text-align: center; opacity: .9; }
.sidebar .sb-foot { padding: 14px 20px; border-top: 1px solid rgba(255, 255, 255, .07); font-size: .8rem; color: #6f82a6; }
.topbar { position: sticky; top: 0; z-index: 40; height: 68px; background: rgba(246, 248, 252, .9); backdrop-filter: blur(10px); display: flex; align-items: center; gap: 12px; padding: 0 24px; border-bottom: 1px solid var(--line-2); }
.topbar .menu-btn { display: inline-flex; }
@media (min-width: 1024px) { .topbar .menu-btn { display: none; } }
.topbar .title { font-weight: 750; font-size: 1.05rem; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-menu { position: relative; }
.user-menu > button { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px 4px 4px; cursor: pointer; font: inherit; color: var(--ink); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--navy-800); color: #fff; display: grid; place-items: center; font-weight: 750; font-size: .85rem; }
.user-menu .um-name { font-weight: 650; font-size: .9rem; max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 600px) { .user-menu .um-name { display: none; } }
.dropdown { position: absolute; right: 0; top: calc(100% + 8px); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-lg); min-width: 230px; padding: 8px; animation: fade-in 140ms var(--ease); }
.dropdown a, .dropdown button { display: block; width: 100%; text-align: left; padding: 10px 12px; border-radius: 8px; color: var(--ink); background: none; border: 0; font: inherit; cursor: pointer; text-decoration: none; }
.dropdown a:hover, .dropdown button:hover { background: var(--navy-50); text-decoration: none; }
.dropdown .dd-head { padding: 8px 12px 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 6px; font-size: .85rem; color: var(--ink-3); }
.panel-content { padding: 24px; max-width: 1320px; }
@media (max-width: 600px) { .panel-content { padding: 16px; } .card { padding: 18px; } }
.page-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; justify-content: space-between; margin-bottom: 20px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 4px 0 0; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 16px; }
.toolbar .input, .toolbar .select { min-height: 42px; width: auto; min-width: 180px; }
.sb-overlay { position: fixed; inset: 0; background: rgba(6, 23, 51, .4); z-index: 55; }
.big-cta { min-height: 60px; font-size: 1.05rem; letter-spacing: .02em; width: 100%; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; padding-top: 10px; }
.bars .b { flex: 1; background: var(--navy-100); border-radius: 6px 6px 2px 2px; position: relative; min-height: 4px; transition: height 400ms var(--ease); }
.bars .b i { position: absolute; left: 0; right: 0; bottom: 0; background: var(--navy-700); border-radius: 6px 6px 2px 2px; }
.bars-legend { display: flex; justify-content: space-between; font-size: .72rem; color: var(--ink-4); margin-top: 6px; }
.rank { list-style: none; margin: 0; padding: 0; }
.rank li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: .92rem; }
.rank li:last-child { border-bottom: 0; }
.kv { display: grid; grid-template-columns: minmax(120px, 40%) 1fr; gap: 8px 16px; font-size: .92rem; margin: 0; }
.kv dt { color: var(--ink-3); }
.kv dd { margin: 0; font-weight: 600; word-break: break-word; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; }
.tabs button { background: none; border: 0; padding: 12px 16px; font: inherit; font-weight: 650; color: var(--ink-3); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--navy-800); border-bottom-color: var(--orange-500); }

/* ---------------------------------------------------------------- Portal do cliente (mobile-first) */
.mobile { min-height: 100vh; display: flex; flex-direction: column; background: var(--surface); }
.mobile-head { padding: 16px; display: flex; justify-content: center; border-bottom: 1px solid var(--line-2); }
.mobile-body { flex: 1; width: min(520px, 100%); margin: 0 auto; padding: 24px 18px 32px; }
.mobile-foot { padding: 16px; text-align: center; font-size: .78rem; color: var(--ink-4); }
.terms-box { max-height: 260px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; font-size: .9rem; background: var(--bg); white-space: pre-wrap; color: var(--ink-2); }
.camera { position: relative; border-radius: 22px; overflow: hidden; background: #0a1528; aspect-ratio: 3 / 4; }
.camera video, .camera img { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); }
.camera .oval { position: absolute; inset: 12% 18%; border: 3px solid rgba(255, 255, 255, .85); border-radius: 50%; box-shadow: 0 0 0 999px rgba(6, 23, 51, .45); }

/* ---------------------------------------------------------------- Utilitários */
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.end { justify-content: flex-end; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 32px; }
.mb-0 { margin-bottom: 0; } .mb-2 { margin-bottom: 16px; }
.w-100 { width: 100%; }
.text-success { color: var(--success); } .text-danger { color: var(--danger); } .text-warning { color: var(--warning); }
.strong { font-weight: 700; }
.mono { font-family: ui-monospace, Consolas, monospace; }
.nowrap { white-space: nowrap; }
.fade-in { animation: fade-up 260ms var(--ease) both; }

/* ---------------------------------------------------------------- Animações */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(.65); opacity: .55; } }
@keyframes indeterminate { 0% { left: -40%; } 100% { left: 100%; } }
@keyframes shimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-up { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes card-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes modal-in { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toast-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
@keyframes pop { 0% { transform: scale(.4); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes qr-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(240, 160, 32, .0); } 50% { box-shadow: 0 0 0 10px rgba(240, 160, 32, .18); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-iteration-count: 1 !important; transition-duration: 1ms !important; }
}

/* ---------------------------------------------------------------- Borderô / boletos */
.mono { font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: .85rem; letter-spacing: .02em; }
.boleto { background: #fff; color: #111; border: 1px dashed #999; border-radius: 8px; padding: 16px; margin-bottom: 16px; page-break-inside: avoid; }
.boleto-head { display: flex; gap: 16px; align-items: center; border-bottom: 2px solid #111; padding-bottom: 8px; flex-wrap: wrap; }
.boleto-head .bank { font-weight: 800; border-left: 2px solid #111; border-right: 2px solid #111; padding: 0 12px; }
.boleto-head .line { margin-left: auto; font-weight: 700; }
.boleto-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 0; margin: 8px 0 12px; }
.boleto-grid > div { border-bottom: 1px solid #ddd; padding: 6px 4px; font-size: .9rem; }
.boleto-grid small { display: block; color: #666; font-size: .7rem; text-transform: uppercase; }
.barcode { width: 100%; max-width: 420px; height: 50px; display: block; }
@media (max-width: 640px) { .boleto-grid { grid-template-columns: 1fr; } .boleto-head .line { margin-left: 0; } }
@media print {
  .sidebar, .topbar, .no-print, .toasts { display: none !important; }
  .panel-main { margin: 0 !important; padding: 0 !important; }
  .panel-content { padding: 0 !important; }
  body { background: #fff !important; }
  .card { box-shadow: none !important; border: 1px solid #ddd !important; }
}

/* ---------------------------------------------------------------- Kit administrativo */
.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.filters .field { margin: 0; min-width: 160px; flex: 1 1 160px; max-width: 260px; }
.pager { display: flex; gap: 8px; align-items: center; justify-content: flex-end; padding: 12px 16px; }
.pager .muted { margin-right: auto; }
.pager:empty { display: none; }
.code-block { background: var(--navy-900, #0B2A5B); color: #e6edf8; padding: 10px 12px; border-radius: 8px; font-size: .78rem; max-width: 520px; max-height: 260px; overflow: auto; white-space: pre-wrap; word-break: break-all; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px 12px; }
.perm-table td, .perm-table th { padding: 8px 10px; }
.perm-table .grp td { background: var(--line-2); font-weight: 700; text-transform: uppercase; font-size: .74rem; letter-spacing: .05em; }
.perm-table select { min-width: 120px; padding: 4px 8px; height: 34px; }
.provider-logo { width: 40px; height: 40px; border-radius: 8px; object-fit: contain; background: #fff; border: 1px solid var(--line-2); vertical-align: middle; }
.provider-logo.lg { width: 96px; height: 96px; }
.int-grid { display: grid; gap: 20px; }
@media (min-width: 980px) { .int-grid { grid-template-columns: 1fr 1fr; } }
.ticket-msg { border: 1px solid var(--line-2); border-radius: 10px; padding: 12px 14px; margin-bottom: 10px; }
.ticket-msg.agent { background: var(--orange-100); border-color: transparent; }
.ticket-msg.internal { background: #fff7d6; border-style: dashed; }
.ticket-msg .meta { font-size: .78rem; color: var(--ink-3); margin-bottom: 4px; }

/* ---------------------------------------------------------------- Nova venda: modo foco (resto da tela 70% escuro) */
/* A área da venda projeta uma sombra de 70% sobre o restante; menu e topo recebem a própria camada escura e ficam bloqueados */
body.sale-focus #sale-zone { position: relative; z-index: 71; background: var(--bg, #f6f8fc); border-radius: 16px; padding: 16px; box-shadow: 0 0 0 200vmax rgba(0, 0, 0, .7); }
body.sale-focus .sidebar, body.sale-focus .topbar, body.sale-focus .page-head { pointer-events: none; user-select: none; }
body.sale-focus .sidebar::after, body.sale-focus .topbar::after { content: ''; position: absolute; inset: 0; background: rgba(0, 0, 0, .7); z-index: 5; }
.sale-focus-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--navy-900, #0B2A5B); color: #fff; border-radius: 10px; padding: 10px 14px; margin-bottom: 14px; }
.sale-focus-bar .muted { color: #c9d6ee; }
.sale-focus-bar .btn { background: #fff; color: var(--navy-900, #0B2A5B); }
/* Documentos da venda (contrato + borderô) */
.sale-doc { background: #fff; color: #111; border: 1px solid #ddd; border-radius: 8px; padding: 28px 32px; margin-bottom: 18px; line-height: 1.55; font-size: .93rem; }
.sale-doc h2 { text-align: center; font-size: 1.15rem; margin-bottom: 4px; }
.sale-doc h4 { margin: 16px 0 6px; font-size: .95rem; }
.sale-doc .sig { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 46px; text-align: center; font-size: .8rem; }
.sale-doc .sig div { border-top: 1px solid #333; padding-top: 6px; }
.print-required { border: 2px solid var(--orange-500, #F0A020); }
@media print {
  body.sale-focus .sidebar::after, body.sale-focus .topbar::after { display: none; }
  body.sale-focus #sale-zone { box-shadow: none !important; padding: 0; background: #fff; }
  .sale-doc { border: 0; padding: 0; page-break-after: always; }
  .boleto { page-break-inside: avoid; }
}

/* ---------------------------------------------------------------- Menu superior (opção definida pelo Super Admin) */
.topmenu { display: none; }
/* No celular, os dois modos usam a barra lateral com o botão ☰ */
@media (min-width: 1024px) {
  body.menu-top .sidebar { display: none; }
  body.menu-top .panel-main { margin-left: 0; }
  body.menu-top .topbar .menu-btn { display: none; }
  body.menu-top .topmenu {
    display: flex; align-items: center; gap: 2px; flex-wrap: wrap;
    position: sticky; top: 0; z-index: 45;
    background: var(--navy-950); padding: 0 16px; min-height: 52px;
  }
  body.menu-top .topmenu .tm-brand { background: #fff; border-radius: 10px; padding: 4px 10px; margin-right: 10px; display: inline-flex; align-items: center; }
  body.menu-top .tm-cat { position: relative; }
  body.menu-top .tm-cat > button {
    background: none; border: 0; color: #c1cde3; font: inherit; font-weight: 600; cursor: pointer;
    padding: 14px 14px; display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; border-bottom: 3px solid transparent;
  }
  body.menu-top .tm-cat > button:hover { color: #fff; }
  body.menu-top .tm-cat.active > button { color: #fff; border-bottom-color: var(--orange-500, #F0A020); }
  body.menu-top .tm-cat.open > button .tm-caret { transform: rotate(180deg); }
  body.menu-top .tm-caret { font-size: .7rem; transition: transform 160ms var(--ease); }
  body.menu-top .tm-drop {
    position: absolute; top: calc(100% - 2px); left: 0; min-width: 240px;
    background: var(--surface); border: 1px solid var(--line); border-radius: 0 0 var(--radius) var(--radius);
    box-shadow: var(--shadow-lg); padding: 8px; z-index: 46; animation: fade-in 140ms var(--ease);
  }
  body.menu-top .tm-drop a {
    display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
    color: var(--ink-1); text-decoration: none; font-size: .92rem; white-space: nowrap;
  }
  body.menu-top .tm-drop a:hover { background: var(--line-2); }
  body.menu-top .tm-drop a.active { background: var(--orange-100, #fdecc8); color: var(--navy-900, #0B2A5B); font-weight: 600; }
  body.menu-top .tm-drop .ico { width: 20px; text-align: center; color: var(--ink-3); }
  body.menu-top .tm-cta { margin-left: auto; }
}

/* Configurações → opção de menu */
.menu-opt { display: flex; gap: 14px; align-items: center; border: 2px solid var(--line-2); border-radius: var(--radius); padding: 14px; cursor: pointer; }
.menu-opt.selected { border-color: var(--orange-500, #F0A020); background: var(--orange-100, #fdecc8); }
.menu-opt input { margin-top: 2px; accent-color: var(--navy-800); }
.menu-opt-art svg { display: block; border-radius: 6px; }
