/* ==========================================================================
   Tax Advisors Consult – design system
   ========================================================================== */
:root {
  --ink: #0e1b2e;
  --ink-2: #1c2b44;
  --text: #1f2a3c;
  --muted: #5d6879;
  --faint: #8a94a4;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #f9fafb;
  --border: #e3e7ed;
  --border-2: #d3d9e2;
  --brand: #14396b;
  --brand-600: #1b4a8a;
  --brand-50: #eef3fb;
  --brand-100: #dbe6f6;
  --gold: #b8873a;
  --gold-50: #faf4e8;
  --green: #17734f;
  --green-50: #e9f6ef;
  --red: #b42318;
  --red-50: #fdecea;
  --amber: #9a6700;
  --amber-50: #fff6dc;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(14, 27, 46, .06);
  --shadow: 0 1px 2px rgba(14, 27, 46, .05), 0 8px 24px -8px rgba(14, 27, 46, .12);
  --shadow-lg: 0 24px 60px -20px rgba(14, 27, 46, .35);
  --serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  --sans: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --max: 1180px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.6; color: var(--text);
  background: var(--bg); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img, svg { display: block; max-width: 100%; }
a { color: var(--brand-600); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.2; margin: 0 0 .5em; letter-spacing: -.01em; }
h1, h2, .serif { font-family: var(--serif); font-weight: 600; }
h1 { font-size: clamp(1.9rem, 1.2rem + 2.4vw, 2.9rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.45rem, 1.1rem + 1.2vw, 2rem); }
h3 { font-size: 1.12rem; font-weight: 650; }
p { margin: 0 0 1em; }
small, .small { font-size: .875rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.container { max-width: var(--max); margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 820px; }
.stack > * + * { margin-top: 16px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; }
.hide-sm { }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.pre { white-space: pre-wrap; }
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon-lg { width: 24px; height: 24px; }

/* ---------- Header ---------- */
.topbar { background: var(--ink); color: #c9d3e3; font-size: .82rem; }
.topbar .container { display: flex; justify-content: space-between; gap: 16px; padding-top: 7px; padding-bottom: 7px; }
.topbar a { color: #fff; }
.header { background: rgba(255,255,255,.92); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 40; }
.header .container { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { white-space: nowrap; display: flex; align-items: center; gap: 10px; color: var(--ink); font-family: var(--serif); font-weight: 700; font-size: 1.35rem; letter-spacing: -.02em; }
.logo:hover { text-decoration: none; }
.logo-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(140deg, var(--brand) 0%, #0b2347 100%); display: grid; place-items: center; box-shadow: inset 0 0 0 1px rgba(255,255,255,.08); }
.logo-mark svg { width: 20px; height: 20px; stroke: #e7c27d; }
.logo small { display: block; font-family: var(--sans); font-weight: 500; font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-top: -3px; }
.nav { display: flex; gap: 4px; flex: 1; }
.nav a { white-space: nowrap; color: var(--ink-2); font-weight: 500; font-size: .94rem; padding: 8px 12px; border-radius: 8px; }
.nav a:hover, .nav a.active { background: var(--brand-50); color: var(--brand); text-decoration: none; }
.header-actions { display: flex; gap: 10px; align-items: center; }
.menu-toggle { display: none; background: none; border: 1px solid var(--border); border-radius: 8px; padding: 8px; cursor: pointer; color: var(--ink); }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 4px 6px 4px 4px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); color: var(--ink); font-size: .9rem; font-weight: 500; }
.user-chip:hover { text-decoration: none; border-color: var(--border-2); }
.avatar { width: 30px; height: 30px; border-radius: 50%; background: var(--brand-100); color: var(--brand); display: grid; place-items: center; font-weight: 700; font-size: .78rem; letter-spacing: .02em; flex: none; }
.avatar-lg { width: 52px; height: 52px; font-size: 1.05rem; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 10px 18px; border-radius: 9px; font: 600 .94rem/1.2 var(--sans); border: 1px solid transparent; cursor: pointer; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; white-space: nowrap; text-decoration: none !important; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; box-shadow: 0 1px 0 rgba(255,255,255,.12) inset, 0 1px 2px rgba(14,27,46,.25); }
.btn-primary:hover { background: var(--brand-600); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: #a57731; }
.btn-outline { background: var(--surface); color: var(--ink); border-color: var(--border-2); }
.btn-outline:hover { border-color: var(--ink-2); }
.btn-ghost { background: transparent; color: var(--ink-2); }
.btn-ghost:hover { background: var(--brand-50); }
.btn-danger { background: var(--surface); color: var(--red); border-color: #f1c6c1; }
.btn-danger:hover { background: var(--red-50); }
.btn-success { background: var(--green); color: #fff; }
.btn-lg { padding: 14px 24px; font-size: 1rem; border-radius: 10px; }
.btn-sm { padding: 7px 12px; font-size: .84rem; border-radius: 7px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.link-btn { background: none; border: 0; padding: 0; color: var(--brand-600); font: inherit; cursor: pointer; }

/* ---------- Hero ---------- */
.hero { position: relative; background: radial-gradient(1200px 500px at 85% -10%, #1f4f91 0%, transparent 60%), linear-gradient(180deg, #0e1b2e 0%, #13284a 100%); color: #d8e1ef; overflow: hidden; }
.hero::after { content: ''; position: absolute; inset: 0; background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px); background-size: 48px 48px; mask-image: linear-gradient(180deg, #000 0%, transparent 85%); pointer-events: none; }
.hero .container { position: relative; z-index: 1; display: grid; grid-template-columns: 1.15fr .85fr; gap: 56px; padding-top: 76px; padding-bottom: 84px; align-items: center; }
.hero h1 { color: #fff; margin-bottom: 18px; }
.hero h1 em { font-style: normal; color: #e7c27d; }
.hero .lead { font-size: 1.15rem; color: #b9c6da; max-width: 560px; margin-bottom: 28px; }
.eyebrow { display: inline-flex; align-items: center; gap: 8px; font-size: .78rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--gold); margin-bottom: 14px; }
.hero .eyebrow { color: #e7c27d; }
.hero-search { display: flex; background: #fff; border-radius: 12px; padding: 6px; box-shadow: var(--shadow-lg); max-width: 580px; }
.hero-search input { flex: 1; border: 0; outline: 0; font: 500 1rem var(--sans); padding: 10px 14px; color: var(--ink); background: transparent; min-width: 0; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; font-size: .86rem; }
.hero-tags a { color: #c9d5e8; border: 1px solid rgba(255,255,255,.16); padding: 4px 11px; border-radius: 999px; }
.hero-tags a:hover { background: rgba(255,255,255,.08); text-decoration: none; }
.hero-card { background: rgba(255,255,255,.97); color: var(--text); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 24px; position: relative; }
.hero-card::before { content: ''; position: absolute; inset: -10px 18px auto auto; width: 72%; height: 100%; border-radius: 16px; background: rgba(255,255,255,.08); z-index: -1; transform: rotate(3deg); }
.hero-card .q { display: flex; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); font-size: .92rem; }
.hero-card .q:first-of-type { border-top: 0; }
.qnum { flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--brand-50); color: var(--brand); font-weight: 700; font-size: .8rem; display: grid; place-items: center; }
.hero-stats { display: flex; gap: 36px; margin-top: 40px; }
.hero-stats strong { display: block; font-family: var(--serif); font-size: 1.9rem; color: #fff; line-height: 1.1; }
.hero-stats span { font-size: .85rem; color: #9fb0c9; }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-sm { padding: 48px 0; }
.section-white { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head { max-width: 680px; margin-bottom: 40px; }
.section-head.center { text-align: center; margin-left: auto; margin-right: auto; }
.section-head p { color: var(--muted); font-size: 1.06rem; }
.page-head { background: var(--surface); border-bottom: 1px solid var(--border); padding: 40px 0 32px; }
.page-head h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem); margin-bottom: 6px; }
.page-head p { color: var(--muted); margin: 0; }
.breadcrumbs { font-size: .85rem; color: var(--faint); margin-bottom: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.breadcrumbs a { color: var(--muted); }

.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.layout-side { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.layout-filter { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 32px; align-items: start; }
.sticky { position: sticky; top: 88px; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
.card-pad { padding: 24px; }
.card-head { padding: 18px 24px; border-bottom: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.card-head h2, .card-head h3 { margin: 0; font-size: 1.05rem; font-family: var(--sans); font-weight: 650; }
.card-body { padding: 24px; }
.card-foot { padding: 16px 24px; border-top: 1px solid var(--border); background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }

.feature { padding: 28px; }
.feature .ficon { width: 46px; height: 46px; border-radius: 11px; background: var(--brand-50); color: var(--brand); display: grid; place-items: center; margin-bottom: 18px; }
.feature p { color: var(--muted); margin: 0; font-size: .95rem; }

.steps { counter-reset: step; display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.step { position: relative; padding: 26px 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.step::before { counter-increment: step; content: '0' counter(step); font-family: var(--serif); font-size: 2.1rem; font-weight: 600; color: var(--gold); display: block; line-height: 1; margin-bottom: 14px; }
.step p { color: var(--muted); font-size: .93rem; margin: 0; }

/* Case card */
.case-card { display: flex; flex-direction: column; padding: 22px; transition: border-color .15s, box-shadow .15s, transform .15s; height: 100%; color: inherit; }
.case-card:hover { border-color: var(--border-2); box-shadow: var(--shadow); text-decoration: none; transform: translateY(-1px); }
.case-card h3 { font-family: var(--serif); font-size: 1.14rem; font-weight: 600; margin: 10px 0 8px; color: var(--ink); }
.case-card p { color: var(--muted); font-size: .92rem; margin-bottom: 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.case-meta { margin-top: auto; display: flex; gap: 14px; align-items: center; font-size: .82rem; color: var(--faint); padding-top: 14px; border-top: 1px dashed var(--border); flex-wrap: wrap; }
.case-meta span { display: inline-flex; align-items: center; gap: 5px; }
.case-meta .icon { width: 15px; height: 15px; }
.case-row { display: flex; gap: 18px; padding: 20px 22px; border-top: 1px solid var(--border); color: inherit; align-items: flex-start; }
.case-row:first-child { border-top: 0; }
.case-row:hover { background: var(--surface-2); text-decoration: none; }
.case-row h3 { font-family: var(--serif); font-weight: 600; font-size: 1.12rem; margin: 6px 0 6px; }
.case-row p { color: var(--muted); font-size: .92rem; margin: 0 0 10px; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--brand-50); color: var(--brand); line-height: 1.5; white-space: nowrap; }
.badge-gold { background: var(--gold-50); color: #8a6224; }
.badge-green { background: var(--green-50); color: var(--green); }
.badge-red { background: var(--red-50); color: var(--red); }
.badge-amber { background: var(--amber-50); color: var(--amber); }
.badge-gray { background: #eef0f3; color: #4b5565; }
.badge-dot::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status-draft { background: #eef0f3; color: #4b5565; }
.status-pending_payment { background: var(--amber-50); color: var(--amber); }
.status-open { background: var(--brand-50); color: var(--brand); }
.status-claimed { background: #f1ecfd; color: #5b3cc4; }
.status-answered { background: var(--green-50); color: var(--green); }
.status-cancelled { background: var(--red-50); color: var(--red); }
.status-paid { background: var(--green-50); color: var(--green); }
.status-pending { background: var(--amber-50); color: var(--amber); }
.status-failed { background: var(--red-50); color: var(--red); }

/* ---------- Case detail ---------- */
.case-statement { font-size: 1.04rem; line-height: 1.75; color: var(--ink-2); }
.qa { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.qa + .qa { margin-top: 16px; }
.qa-q { display: flex; gap: 14px; padding: 20px 22px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 600; color: var(--ink); }
.qa-a { padding: 20px 22px 22px 62px; position: relative; line-height: 1.75; }
.qa-a::before { content: 'R'; position: absolute; left: 22px; top: 21px; width: 26px; height: 26px; border-radius: 7px; background: var(--green-50); color: var(--green); font-weight: 700; font-size: .8rem; display: grid; place-items: center; }
.answer-locked { position: relative; }
.answer-locked .fade { position: relative; }
.answer-locked .fade::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 70%; background: linear-gradient(180deg, rgba(255,255,255,0), #fff 92%); }
.lock-line { display: block; height: 10px; border-radius: 4px; background: #e9edf2; margin-top: 10px; filter: blur(.4px); }
.paywall { border: 1px solid #ead9b8; background: linear-gradient(180deg, #fffaf0 0%, #fff 100%); border-radius: var(--radius); padding: 30px; text-align: center; box-shadow: var(--shadow); }
.paywall .picon { width: 54px; height: 54px; border-radius: 50%; display: grid; place-items: center; background: var(--gold-50); color: var(--gold); margin: 0 auto 14px; border: 1px solid #ead9b8; }
.paywall-opts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 22px; text-align: left; }
.paywall-opt { border: 1px solid var(--border); border-radius: 10px; padding: 18px; background: #fff; display: flex; flex-direction: column; gap: 6px; }
.paywall-opt strong.price { font-family: var(--serif); font-size: 1.6rem; color: var(--ink); }
.conclusion { border-left: 3px solid var(--gold); background: var(--gold-50); padding: 18px 22px; border-radius: 0 10px 10px 0; }
.consultant-card { display: flex; gap: 14px; align-items: flex-start; }
.disclaimer { font-size: .82rem; color: var(--faint); border-top: 1px solid var(--border); padding-top: 16px; margin-top: 28px; }

/* ---------- Pricing ---------- */
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; align-items: stretch; }
.plan { display: flex; flex-direction: column; padding: 30px 28px; position: relative; }
.plan.featured { border: 2px solid var(--brand); box-shadow: var(--shadow); }
.plan .ribbon { position: absolute; top: -12px; left: 28px; background: var(--brand); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 4px 10px; border-radius: 6px; }
.plan .price { font-family: var(--serif); font-size: 2.5rem; font-weight: 600; color: var(--ink); line-height: 1; margin: 14px 0 4px; }
.plan .price small { font-family: var(--sans); font-size: .9rem; color: var(--muted); font-weight: 500; }
.plan ul { list-style: none; padding: 0; margin: 22px 0 26px; display: grid; gap: 10px; font-size: .94rem; }
.plan li { display: flex; gap: 10px; align-items: flex-start; }
.plan li .icon { color: var(--green); margin-top: 3px; width: 17px; height: 17px; }
.plan .btn { margin-top: auto; }
.per-case { display: flex; justify-content: space-between; gap: 24px; align-items: center; padding: 26px 30px; flex-wrap: wrap; }

/* ---------- Forms ---------- */
.form-grid { display: grid; gap: 18px; }
.form-2 { grid-template-columns: 1fr 1fr; }
label.lbl, .lbl { display: block; font-weight: 600; font-size: .9rem; color: var(--ink-2); margin-bottom: 6px; }
.hint { font-size: .82rem; color: var(--faint); margin-top: 5px; }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 13px; border: 1px solid var(--border-2); border-radius: 9px; background: #fff;
  font: 400 .96rem/1.5 var(--sans); color: var(--ink); transition: border-color .15s, box-shadow .15s;
}
textarea.input { resize: vertical; min-height: 110px; }
.input:focus { outline: 0; border-color: var(--brand-600); box-shadow: 0 0 0 4px rgba(27, 74, 138, .12); }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--muted); }
.check input { margin-top: 4px; width: 17px; height: 17px; accent-color: var(--brand); }
.input-group { display: flex; }
.input-group .input { border-radius: 9px 0 0 9px; }
.input-group .addon { padding: 0 14px; display: grid; place-items: center; border: 1px solid var(--border-2); border-left: 0; border-radius: 0 9px 9px 0; background: var(--surface-2); color: var(--muted); font-size: .9rem; font-weight: 600; }
.q-item { display: flex; gap: 12px; align-items: flex-start; }
.q-item textarea { min-height: 70px; }
.q-item .qnum { margin-top: 10px; }
.q-item .remove-q { margin-top: 8px; background: none; border: 0; color: var(--faint); cursor: pointer; padding: 6px; border-radius: 6px; }
.q-item .remove-q:hover { color: var(--red); background: var(--red-50); }
.q-group-sep { display: flex; align-items: center; gap: 10px; color: var(--faint); font-size: .76rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin: 4px 0; }
.q-group-sep::before, .q-group-sep::after { content: ''; flex: 1; height: 1px; background: var(--border); }

.calc { background: var(--ink); color: #c9d3e3; border-radius: var(--radius); padding: 24px; }
.calc h3 { color: #fff; font-family: var(--sans); font-size: 1rem; }
.calc-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid rgba(255,255,255,.08); font-size: .93rem; }
.calc-row strong { color: #fff; }
.calc-total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 16px; }
.calc-total strong { font-family: var(--serif); font-size: 2rem; color: #fff; }
.calc .note { font-size: .82rem; color: #8ea0bb; margin-top: 14px; }

.summary-table { width: 100%; border-collapse: collapse; }
.summary-table td { padding: 12px 0; border-bottom: 1px solid var(--border); }
.summary-table td:last-child { text-align: right; font-weight: 600; color: var(--ink); }
.summary-table tr.total td { border-bottom: 0; padding-top: 18px; font-size: 1.15rem; }
.summary-table tr.total td:last-child { font-family: var(--serif); font-size: 1.7rem; }

/* ---------- Auth ---------- */
.auth-wrap { min-height: calc(100vh - 68px); display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: linear-gradient(180deg, #0e1b2e 0%, #14396b 100%); color: #c9d3e3; padding: 64px; display: flex; flex-direction: column; justify-content: center; position: relative; overflow: hidden; }
.auth-side h2 { color: #fff; font-size: 2rem; }
.auth-side blockquote { margin: 32px 0 0; padding: 22px; border-radius: 12px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.1); font-size: .96rem; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 48px 24px; }
.auth-box { width: 100%; max-width: 440px; }
.auth-box h1 { font-size: 1.9rem; }
.tabs { display: flex; background: #eceff3; padding: 4px; border-radius: 10px; margin-bottom: 24px; }
.tabs a { flex: 1; text-align: center; padding: 9px; border-radius: 7px; font-weight: 600; font-size: .9rem; color: var(--muted); }
.tabs a.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.tabs a:hover { text-decoration: none; }
.demo-accounts { margin-top: 26px; font-size: .82rem; color: var(--muted); background: var(--surface-2); border: 1px dashed var(--border-2); border-radius: 10px; padding: 14px 16px; }
.demo-accounts code { font-size: .8rem; }

/* ---------- Alerts ---------- */
.alert { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border-radius: 10px; font-size: .94rem; border: 1px solid; }
.alert .icon { margin-top: 2px; }
.alert-success { background: var(--green-50); border-color: #bfe3cf; color: #0f5137; }
.alert-error { background: var(--red-50); border-color: #f4c7c2; color: #8a1c12; }
.alert-info { background: var(--brand-50); border-color: var(--brand-100); color: var(--brand); }
.alert-warn { background: var(--amber-50); border-color: #f1dc9f; color: #6e4b00; }
.flash-wrap { position: fixed; top: 82px; right: 20px; z-index: 60; max-width: 420px; animation: slidein .25s ease-out; }
.flash-wrap .alert { box-shadow: var(--shadow); }
@keyframes slidein { from { transform: translateY(-8px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- App shell (cont / consultant / admin) ---------- */
.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: calc(100vh - 68px); }
.sidebar { background: var(--surface); border-right: 1px solid var(--border); padding: 24px 14px; }
.sidebar .side-title { font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; color: var(--faint); padding: 0 12px; margin: 18px 0 8px; }
.sidebar .side-title:first-child { margin-top: 0; }
.sidebar a { display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 8px; color: var(--ink-2); font-weight: 500; font-size: .93rem; }
.sidebar a:hover { background: var(--surface-2); text-decoration: none; }
.sidebar a.active { background: var(--brand-50); color: var(--brand); }
.sidebar a .count { margin-left: auto; background: var(--gold); color: #fff; font-size: .72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.app-main { padding: 32px; min-width: 0; }
.app-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 26px; flex-wrap: wrap; }
.app-head h1 { font-size: 1.75rem; margin: 0; }
.app-head p { margin: 4px 0 0; color: var(--muted); }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 24px; }
.kpi { padding: 20px 22px; }
.kpi .lbl { font-size: .8rem; color: var(--muted); font-weight: 500; margin: 0 0 6px; display: flex; align-items: center; gap: 8px; }
.kpi .val { font-family: var(--serif); font-size: 1.85rem; font-weight: 600; color: var(--ink); line-height: 1.15; }
.kpi .sub { font-size: .8rem; color: var(--faint); margin-top: 4px; }
.kpi-accent { background: linear-gradient(140deg, var(--brand) 0%, #0e2a52 100%); border: 0; color: #c9d3e3; }
.kpi-accent .lbl { color: #a9bbd6; }
.kpi-accent .val { color: #fff; }
.kpi-accent .sub { color: #8ea4c4; }

.table-wrap { overflow-x: auto; }
table.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; font-weight: 600; font-size: .76rem; letter-spacing: .05em; text-transform: uppercase; color: var(--faint); padding: 12px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2); white-space: nowrap; }
.table td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tr:hover td { background: #fbfcfd; }
.table .num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.table .title-cell { font-weight: 600; color: var(--ink); }
.table .title-cell a { color: var(--ink); }
.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .eicon { width: 52px; height: 52px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); display: grid; place-items: center; margin: 0 auto 14px; color: var(--faint); }

.filter-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.pill { padding: 6px 13px; border-radius: 999px; border: 1px solid var(--border-2); background: #fff; font-size: .85rem; font-weight: 500; color: var(--ink-2); }
.pill:hover { text-decoration: none; border-color: var(--ink-2); }
.pill.active { background: var(--ink); color: #fff; border-color: var(--ink); }

.cat-list { list-style: none; margin: 0; padding: 8px; }
.cat-list a { display: flex; justify-content: space-between; padding: 8px 12px; border-radius: 8px; color: var(--ink-2); font-size: .92rem; }
.cat-list a:hover { background: var(--surface-2); text-decoration: none; }
.cat-list a.active { background: var(--brand-50); color: var(--brand); font-weight: 600; }
.cat-list .n { color: var(--faint); font-size: .82rem; }

.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; }
.pagination a, .pagination span { min-width: 38px; height: 38px; display: grid; place-items: center; border-radius: 8px; border: 1px solid var(--border); background: #fff; font-weight: 600; font-size: .9rem; color: var(--ink-2); padding: 0 10px; }
.pagination .active { background: var(--ink); color: #fff; border-color: var(--ink); }

.progress { height: 8px; background: #e9edf2; border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: linear-gradient(90deg, var(--brand), var(--brand-600)); border-radius: 999px; }

.timeline { list-style: none; padding: 0; margin: 0; }
.timeline li { position: relative; padding: 0 0 18px 28px; font-size: .9rem; }
.timeline li::before { content: ''; position: absolute; left: 6px; top: 6px; width: 10px; height: 10px; border-radius: 50%; background: var(--border-2); }
.timeline li::after { content: ''; position: absolute; left: 10px; top: 18px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::after { display: none; }
.timeline li.done::before { background: var(--green); }
.timeline li.now::before { background: var(--gold); box-shadow: 0 0 0 4px var(--gold-50); }

.trust { display: flex; justify-content: center; gap: 44px; flex-wrap: wrap; color: var(--faint); font-size: .9rem; font-weight: 600; }
.trust span { display: inline-flex; gap: 8px; align-items: center; }

.cta-band { background: linear-gradient(120deg, #0e1b2e 0%, #14396b 100%); color: #c9d3e3; border-radius: 18px; padding: 48px; display: flex; justify-content: space-between; align-items: center; gap: 32px; flex-wrap: wrap; }
.cta-band h2 { color: #fff; margin-bottom: 6px; }

.faq details { border-bottom: 1px solid var(--border); padding: 18px 0; }
.faq summary { font-weight: 600; color: var(--ink); cursor: pointer; list-style: none; display: flex; justify-content: space-between; gap: 16px; }
.faq summary::after { content: '+'; font-size: 1.3rem; color: var(--faint); line-height: 1; }
.faq details[open] summary::after { content: '–'; }
.faq details p { margin: 12px 0 0; color: var(--muted); }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: #93a3bb; padding: 56px 0 28px; margin-top: 0; font-size: .92rem; }
.footer .cols { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 32px; }
.footer h4 { color: #fff; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; margin-bottom: 14px; }
.footer a { color: #c3cfe0; display: block; padding: 3px 0; }
.footer .logo { color: #fff; margin-bottom: 14px; }
.footer .bottom { border-top: 1px solid rgba(255,255,255,.08); margin-top: 40px; padding-top: 22px; display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; font-size: .82rem; }
.netopia-badge { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid rgba(255,255,255,.15); border-radius: 8px; color: #c3cfe0; font-size: .8rem; }

/* Demo payment page */
.pay-box { max-width: 480px; margin: 56px auto; }
.pay-box .card-head { background: #0f2a4f; color: #fff; border-radius: var(--radius) var(--radius) 0 0; }
.pay-box .card-head h2 { color: #fff; }
.fake-card { background: linear-gradient(135deg, #1b4a8a, #0e1b2e); color: #fff; border-radius: 14px; padding: 22px; font-family: ui-monospace, monospace; letter-spacing: .12em; margin-bottom: 20px; }

.plan-form { grid-template-columns: 2fr 1fr 1fr 1fr 90px; }
@media (max-width: 760px) { .plan-form { grid-template-columns: 1fr 1fr; } .plan-form > div:first-child { grid-column: 1 / -1; } }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 920px) {
  .hero .container, .layout-side, .layout-filter, .auth-wrap { grid-template-columns: 1fr; }
  .hero .container { padding-top: 48px; padding-bottom: 56px; gap: 36px; }
  .auth-side { display: none; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .app { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--border); padding: 10px 12px; display: flex; gap: 4px; overflow-x: auto; }
  .sidebar .side-title { display: none; }
  .sidebar a { white-space: nowrap; }
  .app-main { padding: 22px 16px; }
  .footer .cols { grid-template-columns: 1fr 1fr; }
  .sticky { position: static; }
}
@media (max-width: 1180px) { .app .layout-side { grid-template-columns: 1fr; } .app .sticky { position: static; } }
@media (max-width: 1040px) {
  .nav { display: none; position: absolute; top: 68px; left: 0; right: 0; background: #fff; flex-direction: column; padding: 12px 16px; border-bottom: 1px solid var(--border); box-shadow: var(--shadow); }
  .nav.open { display: flex; }
  .menu-toggle { display: inline-flex; }
  .header .container { gap: 12px; }
  .header-actions { margin-left: auto; }
}
@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .grid-2, .grid-3, .grid-4, .form-2, .steps, .kpis, .paywall-opts { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .hero-stats { gap: 22px; }
  .hero-stats strong { font-size: 1.5rem; }
  .topbar .container > :last-child { display: none; }
  .hide-sm { display: none !important; }
  .cta-band { padding: 30px 24px; }
  .qa-a { padding: 18px 18px 20px 18px; }
  .qa-a::before { display: none; }
  .footer .cols { grid-template-columns: 1fr; }
  .flash-wrap { left: 16px; right: 16px; }
  .case-row { flex-direction: column; gap: 8px; }
}

/* ---------- Documente legale ---------- */
.legal-doc { line-height: 1.7; color: var(--text, #2b3648); }
.legal-doc h2 { font-size: 1.28rem; margin: 34px 0 10px; padding-top: 6px; scroll-margin-top: 90px; }
.legal-doc h2:first-of-type { margin-top: 0; }
.legal-doc h3 { font-size: 1.02rem; margin: 18px 0 6px; }
.legal-doc ul, .legal-doc ol { padding-left: 20px; display: grid; gap: 4px; }
.legal-doc table { width: 100%; border-collapse: collapse; margin: 10px 0 16px; font-size: .92rem; }
.legal-doc th, .legal-doc td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal-doc th { background: var(--surface); }
.legal-doc .table-wrap { overflow-x: auto; }
.legal-toc { display: grid; gap: 4px; font-size: .92rem; columns: 2; margin: 0 0 8px; padding: 0; list-style: none; }
.legal-toc a { color: var(--muted); }
.legal-id { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; font-size: .94rem; }
mark.todo { background: var(--amber-50); color: #6e4b00; border: 1px dashed #e0c36a; border-radius: 4px; padding: 0 4px; }
@media (max-width: 640px) { .legal-toc { columns: 1; } }
.code-input { font-size: 1.5rem; letter-spacing: .5em; text-align: center; font-variant-numeric: tabular-nums; }
.link-btn[disabled] { opacity: .5; cursor: default; }
.badge-suspect { background: var(--red-50); color: #8a1c12; border: 1px solid #f4c7c2; }

/* Domenii consultant */
.domain-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 8px 16px; margin-top: 6px; }
.domain-grid .check { font-size: .92rem; }

/* Întrebări suplimentare consultant ↔ client */
.thread { display: grid; gap: 12px; }
.msg { max-width: 85%; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); }
.msg-mine { margin-left: auto; background: #eef3fb; border-color: #d5e0f2; }
.msg-meta { font-size: .8rem; color: var(--muted); margin-bottom: 4px; }
@media (max-width: 640px) { .msg { max-width: 100%; } }

/* Documente justificative */
.file-list { list-style: none; padding: 0; margin: 10px 0 0; display: grid; gap: 6px; }
.file-list li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .92rem; }
.upload-box { border: 1px dashed var(--border); border-radius: 10px; padding: 12px 14px; }
.upload-box.upload-asked { border-color: var(--gold); background: #fbf7ee; }

/* ---------- Asistent AI (consultant) ---------- */
.ai-tools { border-style: dashed; }
.ai-panel { margin-top: 14px; }
.ai-loading { display: flex; align-items: center; gap: 10px; opacity: .8; padding: 10px 0; }
.spinner { width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; display: inline-block; animation: aispin .8s linear infinite; }
@keyframes aispin { to { transform: rotate(360deg); } }
.ai-compare { border: 1px solid rgba(15, 35, 70, .14); border-radius: 10px; padding: 12px 14px; margin-bottom: 12px; }
.ai-compare.ai-applied { border-color: #c9a227; background: rgba(201, 162, 39, .06); }
.ai-compare-title { font-weight: 600; margin-bottom: 8px; }
.ai-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.ai-col-h { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; opacity: .7; margin-bottom: 4px; }
.ai-text { font-size: 14px; line-height: 1.55; background: rgba(15, 35, 70, .04); border-radius: 8px; padding: 10px 12px; max-height: 460px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
.ai-new { background: rgba(201, 162, 39, .09); }
.ai-sources { margin: 8px 0 0 18px; font-size: 14px; }
@media (max-width: 760px) { .ai-cols { grid-template-columns: 1fr; } }

/* ---------- Domeniu recomandat (speță nouă) ---------- */
.cat-suggest { margin-top: 8px; font-size: .9rem; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: #5a4310; background: rgba(184, 135, 58, .1); border-radius: 8px; padding: 8px 12px; }
.cat-suggest .spinner { width: 14px; height: 14px; }
.cat-suggest[hidden] { display: none; }
.stars { display: inline-flex; flex-direction: row-reverse; gap: 4px; }
.stars input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.stars label { font-size: 2rem; line-height: 1; color: #d0d5dd; cursor: pointer; transition: color .1s, transform .1s; }
.stars label:hover, .stars label:hover ~ label, .stars input:checked ~ label { color: #e0a526; }
.stars label:hover { transform: scale(1.12); }
.stars input:focus-visible + label { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 4px; }
.stars-ro { font-size: 1.3rem; letter-spacing: 2px; color: #d0d5dd; line-height: 1; }
.stars-ro .on { color: #e0a526; }
.stars-ro.sm { font-size: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sim-box { margin-top: 12px; border: 1px solid rgba(184, 135, 58, .45); background: rgba(184, 135, 58, .07); border-radius: 10px; padding: 14px 16px; }
.sim-box[hidden] { display: none; }
.sim-box h4 { margin: 0 0 4px; font-size: .98rem; color: var(--ink); }
.sim-box p { margin: 0 0 8px; font-size: .88rem; color: var(--muted, #5b6472); }
.sim-box ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.sim-box li a { font-weight: 600; }
.sim-box li span { display: block; font-size: .82rem; color: var(--muted, #5b6472); }
.sim-box .sim-close { float: right; }
.link-inline { text-decoration: underline; font-weight: 600; color: #b42318; }
.badge-urgent { background: #fde8e7; color: #b42318; font-weight: 700; }

/* ---------- Noutăți fiscale ---------- */
.news-card { display: flex; flex-direction: column; gap: 10px; padding: 20px 22px; color: inherit; text-decoration: none; transition: box-shadow .15s, transform .15s; }
.news-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.news-card h3 { font-size: 1.08rem; line-height: 1.35; margin: 0; color: var(--ink); }
.news-card p { margin: 0; flex: 1; }
.news-author { display: flex; align-items: center; gap: 10px; padding-top: 12px; border-top: 1px solid var(--border); font-size: .9rem; }
.news-pillars { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.news-pillars span { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: #fff; border: 1px solid var(--border); font-size: .88rem; font-weight: 600; color: var(--ink); }
.news-block { margin-bottom: 18px; }
.news-block .eyebrow { margin-bottom: 10px; }
.news-interpretation { border-left: 4px solid var(--gold); }
.news-source { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--border); font-size: .9rem; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ---------- Poze de profil ---------- */
img.avatar, .avatar-img { object-fit: cover; padding: 0; background: var(--brand-100); box-shadow: 0 0 0 2px #fff, 0 2px 6px rgba(14,27,46,.15); }
.avatar-xs { width: 20px; height: 20px; font-size: .55rem; }
.cc-author { display: inline-flex; align-items: center; gap: 6px; }
.avatar-photo { width: 88px; height: 88px; font-size: 1.6rem; }
.photo-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }

/* ---------- Raport financiar ---------- */
.fin-filter { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.fin-filter > div:not(.fin-quick) { min-width: 160px; }
.fin-quick { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.fin-quick a { font-size: .82rem; padding: 6px 10px; border: 1px solid var(--border); border-radius: 999px; color: var(--ink-2); }
.fin-quick a:hover { background: var(--brand-50); text-decoration: none; }
.fin-payout { background: var(--green-50); }
tfoot td { border-top: 2px solid var(--border-2); }
@media (max-width: 760px) { .kpis[style] { grid-template-columns: 1fr !important; } }

/* ---------- Date de facturare ---------- */
.bill-type { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.bill-type label { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; cursor: pointer; background: #fff; }
.bill-type label:has(input:checked) { border-color: var(--brand); background: var(--brand-50); }
.bill-type input { margin-top: 3px; }
.bill-type strong { display: block; color: var(--ink); }
.bill-mini { margin-top: 12px; padding: 10px 12px; border: 1px dashed var(--border-2); border-radius: 10px; line-height: 1.45; }
.anaf-row { display: flex; gap: 8px; }
.anaf-row .input { flex: 1; }
[hidden] { display: none !important; }
@media (max-width: 560px) { .bill-type { grid-template-columns: 1fr; } .anaf-row { flex-direction: column; } }

/* ---------- Echipe ---------- */
.team-readonly form { display: none !important; }
.seat-dots { display: flex; gap: 6px; margin-top: 8px; }
.seat-dots span { width: 26px; height: 8px; border-radius: 99px; background: var(--border); }
.seat-dots span.on { background: var(--brand); }
.seat-dots span.wait { background: var(--gold, #c9a14a); }
.badge-seats { background: var(--brand); color: #fff; }
.team-band { background: linear-gradient(135deg, #0f2a4d, #14396b); color: #e6edf7; border-radius: 22px; padding: 44px; display: grid; grid-template-columns: 1.2fr 1fr; gap: 36px; align-items: center; }
.team-band h2 { color: #fff; margin: 8px 0 12px; }
.team-band p { color: #c3cfe0; }
.team-band ul { list-style: none; padding: 0; margin: 18px 0 0; display: grid; gap: 10px; }
.team-band li { display: flex; gap: 10px; align-items: flex-start; }
.team-band li svg { color: #e2bd6b; flex: none; margin-top: 3px; }
.team-people { display: grid; gap: 12px; }
.team-person { display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); border-radius: 14px; padding: 12px 14px; }
.team-person .avatar { background: #e2bd6b; color: #0f2a4d; }
.team-person small { display: block; color: #a9bbd6; }
@media (max-width: 860px) { .team-band { grid-template-columns: 1fr; padding: 28px 20px; } }
