/* ═══════════════════════════════════════════════════════════
   INVERBOOKS — MIDNIGHT OIL · v2 (refined)
   Deep navy + warm gold, modernized private bank aesthetic.
   ═══════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@400;500;600;700&family=Inter+Tight:wght@400;500;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

:root {
  /* Backgrounds — slightly deeper, bluer black */
  --bg:        #070b16;
  --bg-2:      #0d1322;
  --surface:   #131a2d;
  --surface-2: #1a2238;
  --line:      #1f2841;
  --line-2:    #2d3858;

  /* Text — bumped contrast for readability */
  --text:      #ecebe4;
  --text-2:    #b8b6a8;
  --text-3:    #828699;

  /* Gold — richer, more aligned with the brand logo */
  --gold:       #d4ad6a;
  --gold-2:     #e9c989;
  --gold-3:     #b9914f;
  --gold-soft:  rgba(212, 173, 106, 0.10);
  --gold-glow:  rgba(212, 173, 106, 0.18);
  --gold-line:  rgba(212, 173, 106, 0.32);

  --green: #84c79a;
  --red:   #e08484;

  --serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
  --sans:  'Inter Tight', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono:  'JetBrains Mono', ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Monaco, monospace;

  --max: 1240px;

  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 14px;

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);

  --shadow-sm: 0 1px 2px rgba(0,0,0,.25), 0 2px 8px rgba(0,0,0,.18);
  --shadow:    0 4px 16px rgba(0,0,0,.32), 0 1px 3px rgba(0,0,0,.2);
  --shadow-lg: 0 20px 56px rgba(0,0,0,.45), 0 6px 18px rgba(0,0,0,.28);
}

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  /* FIX: bloqueja scroll horitzontal sense trencar position:sticky del header */
  overflow-x: clip;
  max-width: 100%;
}
body { width: 100%; position: relative; }
body::before {
  content: '';
  position: fixed; inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 70% -10%, rgba(212,173,106,.07), transparent 60%),
    radial-gradient(ellipse 60% 50% at 10% 0%, rgba(80,120,200,.04), transparent 55%);
  pointer-events: none; z-index: 0;
}
body::after {
  /* very subtle grain — adds tactility on dark surfaces */
  content: '';
  position: fixed; inset: 0;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.04 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  opacity: 0.5;
  pointer-events: none;
  z-index: 0;
  mix-blend-mode: overlay;
}
main { position: relative; z-index: 1; }

a {
  color: var(--gold);
  text-decoration: none;
  transition: color 0.18s var(--ease);
}
a:hover { color: var(--gold-2); }
img { max-width: 100%; display: block; }
button {
  font-family: inherit;
  cursor: pointer;
  border: 0;
  background: none;
  color: inherit;
}
input, select, textarea { font-family: inherit; }

*:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 2px;
  border-radius: 3px;
}

::selection { background: var(--gold); color: var(--bg); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 6px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--gold-3); }

.ib-nav, .ib-foot, .kicker, .ib-btn, .ib-pill,
.calc-tab, .calc-empty, .calc-empty-icon,
.aff-card-tag, .rank-tag, .auth-tabs, .auth-mark, .ib-mark,
.chat-head, .chat-suggest, .chat-hint, .chat-credits,
.calc-detail-lab, .field label,
.cookie-bar {
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

/* ─── Typography ─────────────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -0.015em;
  line-height: 1.08;
  color: var(--text);
}
h1 { font-size: clamp(2.6rem, 5.8vw, 4.8rem); }
h2 { font-size: clamp(1.9rem, 3.6vw, 3rem); }
h3 { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.01em; }
h4 { font-size: 1.1rem; font-weight: 600; letter-spacing: -0.005em; }

p { color: var(--text-2); }

.kicker {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.24em;
  color: var(--gold);
}
.lead {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-style: italic;
  color: var(--text-2);
  font-weight: 400;
  line-height: 1.45;
  text-wrap: pretty;
}
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--text-3); }

.container { max-width: var(--max); margin: 0 auto; padding: 0 32px; }
.container-narrow { max-width: 760px; margin: 0 auto; padding: 0 32px; }

/* ═══════════════════════════════════════════════════════════
   NAVBAR
   ═══════════════════════════════════════════════════════════ */

.ib-nav {
  position: sticky; top: 0; z-index: 80;
  background: rgba(7, 11, 22, 0.72);
  backdrop-filter: saturate(140%) blur(18px);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  border-bottom: 1px solid var(--line);
  width: 100%;
}
.ib-nav-inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 16px 32px;
  display: flex;
  align-items: center;
  gap: 32px;
  min-width: 0;
}
.ib-brand {
  display: inline-flex; align-items: center; gap: 14px;
  color: var(--text);
  font-family: var(--serif);
  font-size: 1.45rem;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.ib-brand:hover { color: var(--text); }
.ib-mark {
  width: 36px; height: 36px;
  border: 1px solid var(--gold);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1rem;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, rgba(212,173,106,.06), transparent);
  transition: box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.ib-brand:hover .ib-mark {
  box-shadow: 0 0 0 4px var(--gold-soft);
  border-color: var(--gold-2);
}

.ib-nav-links {
  display: flex; gap: 2px;
  margin-left: auto;
  font-size: 0.88rem;
}
.ib-nav-links a {
  color: var(--text-2);
  font-family: var(--sans);
  padding: 8px 14px;
  letter-spacing: 0.01em;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: color 0.18s var(--ease), background 0.18s var(--ease);
}
.ib-nav-links a:hover { color: var(--text); background: rgba(255,255,255,.03); }
.ib-nav-links a.active { color: var(--gold); }

.ib-nav-cta { display: flex; gap: 10px; align-items: center; position: relative; flex-shrink: 0; }
.ib-nav-cta #ib-nav-guest:not([hidden]) { display: inline-flex; gap: 8px; align-items: center; }
.ib-nav-cta [hidden] { display: none !important; }

.ib-pill {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 6px 14px 6px 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 0.85rem;
  cursor: pointer;
  border-radius: 999px;
  transition: border-color 0.18s var(--ease), background 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.ib-pill:hover {
  border-color: var(--gold-line);
  background: var(--surface-2);
  box-shadow: 0 0 0 4px var(--gold-soft);
}
.ib-pill-credits {
  display: inline-flex; align-items: center; gap: 4px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--bg);
  padding: 4px 11px;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  border-radius: 999px;
}
.ib-pill-credits b { font-weight: 600; }
.ib-pill-credits i { font-style: normal; opacity: 0.78; font-size: 0.68rem; margin-left: 2px; }
.ib-pill-email {
  max-width: 160px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text-2);
  font-size: 0.85rem;
}

.ib-dropdown {
  display: none;
  position: absolute; top: calc(100% + 12px); right: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  min-width: 240px;
  padding: 6px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  flex-direction: column;
  z-index: 90;
}
.ib-dropdown.show { display: flex; animation: fadeDown .18s var(--ease); }
@keyframes fadeDown {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ib-dropdown a, .ib-dropdown button {
  display: block; width: 100%; text-align: left;
  padding: 10px 14px;
  background: none; border: 0;
  color: var(--text);
  font-size: 0.9rem;
  font-family: var(--sans);
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.ib-dropdown a:hover, .ib-dropdown button:hover {
  background: var(--bg-2); color: var(--gold);
}
.ib-dropdown hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

.ib-burger {
  display: none;
  background: none; border: 0;
  flex-direction: column; gap: 4px; padding: 8px;
  border-radius: var(--radius-sm);
}
.ib-burger span {
  display: block; width: 22px; height: 1.5px;
  background: var(--text);
  border-radius: 1px;
}

/* ═══════════════════════════════════════════════════════════
   THEME TOGGLE (light mode opt-in)
   ═══════════════════════════════════════════════════════════ */
.theme-toggle {
  width: 36px; height: 36px;
  border: 1px solid var(--line);
  color: var(--text-3);
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: border-color 0.18s var(--ease), color 0.18s var(--ease), background 0.18s var(--ease);
}
.theme-toggle:hover {
  border-color: var(--gold-line);
  color: var(--gold);
  background: var(--gold-soft);
}

/* Light mode — fintech net: blanc suau, grisos neutres + accent or sòlid */
html.theme-light {
  --bg:        #fbfaf6;   /* gairebé blanc, lleugerament càlid */
  --bg-2:      #f4f2eb;
  --surface:   #ffffff;
  --surface-2: #f7f5ee;
  --line:      #e4e1d4;
  --line-2:    #c9c4b1;
  --text:      #15140f;   /* near-black, alta llegibilitat */
  --text-2:    #4a4639;
  --text-3:    #807a64;
  --gold:      #8a6913;   /* or sòlid, AA contrast sobre blanc */
  --gold-2:    #6b5010;
  --gold-3:    #a47e22;
  --gold-soft: rgba(138, 105, 19, 0.08);
  --gold-glow: rgba(138, 105, 19, 0.14);
  --gold-line: rgba(138, 105, 19, 0.30);
  --green:     #1f7a44;
  --red:       #b13434;

  --shadow-sm: 0 1px 2px rgba(20,16,8,.05), 0 1px 3px rgba(20,16,8,.04);
  --shadow:    0 4px 14px rgba(20,16,8,.06), 0 1px 3px rgba(20,16,8,.05);
  --shadow-lg: 0 18px 44px rgba(20,16,8,.10), 0 4px 12px rgba(20,16,8,.06);
}
html.theme-light body::before {
  background:
    radial-gradient(ellipse 80% 50% at 70% -10%, rgba(138, 105, 19, 0.05), transparent 60%),
    radial-gradient(ellipse 60% 50% at 10% 0%, rgba(80, 90, 120, 0.025), transparent 55%);
}
html.theme-light body::after { display: none; } /* grain noise no escau en clar */

/* Light: navbar i superfícies amb contrast i sense glow excessiu */
html.theme-light .ib-nav {
  background: rgba(251, 250, 246, 0.85);
  border-bottom-color: var(--line);
}
html.theme-light .ib-nav-links a:hover { background: rgba(20,16,8,.04); }
html.theme-light .ib-pill { background: var(--surface); }
html.theme-light .ib-pill:hover { background: var(--surface-2); }
html.theme-light .ib-pill-credits {
  background: linear-gradient(180deg, #c9a040, #8a6913);
  color: #fff;
  box-shadow: 0 1px 2px rgba(138,105,19,.25);
}
html.theme-light .ib-btn { border-color: var(--line-2); color: var(--text); }
html.theme-light .ib-btn:hover {
  border-color: var(--gold);
  color: var(--gold-2);
  background: var(--gold-soft);
}
html.theme-light .ib-btn-primary {
  background: linear-gradient(180deg, #b5872a, #8a6913);
  border-color: #8a6913;
  color: #fff;
  box-shadow: 0 4px 12px rgba(138,105,19,.22), inset 0 1px 0 rgba(255,255,255,.18);
}
html.theme-light .ib-btn-primary:hover {
  background: linear-gradient(180deg, #c69631, #a07b1d);
  color: #fff;
  box-shadow: 0 8px 20px rgba(138,105,19,.30);
}
html.theme-light .hero h1 em {
  -webkit-text-fill-color: var(--gold);
  color: var(--gold);
  background: none;
}
html.theme-light .calc-summary-amount,
html.theme-light .price-amount,
html.theme-light .hero-stat-num { color: var(--gold-2); }
html.theme-light .feat:hover,
html.theme-light .aff-card:hover,
html.theme-light .fiscal-card:hover { background: var(--surface-2); }
html.theme-light ::selection { background: var(--gold); color: #fff; }
html.theme-light .chat-send { color: #fff; }
html.theme-light .chat-bubble strong,
html.theme-light a { color: var(--gold-2); }
html.theme-light a:hover { color: var(--gold); }

/* ═══════════════════════════════════════════════════════════
   BUTTONS
   ═══════════════════════════════════════════════════════════ */

.ib-btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  padding: 12px 22px;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
  border-radius: var(--radius-sm);
  transition: all 0.22s var(--ease);
  font-family: var(--sans);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}
.ib-btn:hover {
  border-color: var(--gold);
  color: var(--gold);
  text-decoration: none;
  background: var(--gold-soft);
  transform: translateY(-1px);
}
.ib-btn:active { transform: translateY(0); }
.ib-btn-primary {
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  border-color: var(--gold);
  color: var(--bg);
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(212,173,106,.22), inset 0 1px 0 rgba(255,255,255,.18);
}
.ib-btn-primary:hover {
  background: linear-gradient(180deg, #f1d293, var(--gold-2));
  border-color: var(--gold-2);
  color: var(--bg);
  box-shadow: 0 8px 24px rgba(212,173,106,.34), inset 0 1px 0 rgba(255,255,255,.24);
}
.ib-btn-lg { padding: 15px 30px; font-size: 0.98rem; }
.ib-btn-sm { padding: 7px 14px; font-size: 0.8rem; }
.ib-btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* ═══════════════════════════════════════════════════════════
   HERO
   ═══════════════════════════════════════════════════════════ */

.hero {
  padding: 112px 32px 96px;
  border-bottom: 1px solid var(--line);
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: '';
  position: absolute; right: -240px; top: -140px;
  width: 720px; height: 720px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 173, 106, 0.10), transparent 62%);
  pointer-events: none;
  filter: blur(2px);
}
.hero-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 72px;
  align-items: end;
  position: relative;
}
.hero-eyebrow {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 32px;
}
.hero-eyebrow .line {
  width: 48px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), var(--gold));
}
.hero h1 {
  margin-bottom: 28px;
  text-wrap: balance;
}
.hero h1 em {
  font-style: italic;
  color: var(--gold);
  font-weight: 500;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
.hero-lead {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.4rem;
  color: var(--text-2);
  max-width: 580px;
  margin-bottom: 42px;
  line-height: 1.45;
  text-wrap: pretty;
}
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; }
.hero-side {
  border: 1px solid var(--line);
  background:
    linear-gradient(180deg, rgba(255,255,255,.012), transparent),
    var(--surface);
  padding: 36px;
  display: grid;
  gap: 24px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  position: relative;
}
.hero-side::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border-top: 1px solid var(--gold-line);
  border-top-left-radius: inherit;
  border-top-right-radius: inherit;
  pointer-events: none;
  opacity: .5;
}
.hero-side .kicker { display: block; }
.hero-stats {
  display: grid; grid-template-columns: 1fr 1fr; gap: 24px;
  border-top: 1px solid var(--line);
  padding-top: 24px;
}
.hero-stat-num {
  font-family: var(--serif);
  font-size: 2.4rem;
  font-weight: 500;
  line-height: 1;
  color: var(--gold);
  letter-spacing: -0.02em;
}
.hero-stat-num.text { color: var(--text); }
.hero-stat-lab {
  font-family: var(--mono);
  font-size: 0.68rem;
  color: var(--text-3);
  margin-top: 10px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
@media (max-width: 880px) {
  .hero-inner { grid-template-columns: 1fr; gap: 48px; }
  .hero { padding: 80px 32px 64px; }
}

/* ═══════════════════════════════════════════════════════════
   SECTIONS
   ═══════════════════════════════════════════════════════════ */

.section { padding: 96px 32px; border-bottom: 1px solid var(--line); position: relative; }
.section-header {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 56px; margin-bottom: 64px;
  align-items: end;
}
.section-header h2 { margin-top: 14px; text-wrap: balance; }

.grid { display: grid; gap: 1px; background: var(--line); border-radius: var(--radius); overflow: hidden; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 880px) {
  .grid-3, .grid-2, .section-header { grid-template-columns: 1fr; }
}

.feat {
  background: var(--bg);
  padding: 40px 36px;
  display: flex; flex-direction: column;
  gap: 14px;
  transition: background 0.25s var(--ease);
  min-height: 300px;
  position: relative;
}
.feat::before {
  content: '';
  position: absolute; left: 0; top: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0;
  transition: opacity 0.3s var(--ease);
}
.feat:hover { background: var(--bg-2); }
.feat:hover::before { opacity: .55; }
.feat-num {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--gold);
  letter-spacing: 0.16em;
  margin-bottom: 12px;
  text-transform: uppercase;
}
.feat h3 {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.feat p { flex: 1; color: var(--text-2); font-size: 0.98rem; line-height: 1.65; }
.feat-link {
  color: var(--gold);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  font-family: var(--mono);
  align-self: flex-start;
  border-bottom: 1px solid transparent;
  padding-bottom: 3px;
  transition: border-color 0.2s var(--ease), letter-spacing 0.2s var(--ease);
}
.feat-link:hover { border-bottom-color: var(--gold); letter-spacing: 0.2em; }

/* ═══════════════════════════════════════════════════════════
   AFFILIATES
   ═══════════════════════════════════════════════════════════ */

.aff-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (max-width: 900px) { .aff-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px) { .aff-grid { grid-template-columns: 1fr; } }

.aff-card {
  background: var(--bg);
  padding: 32px;
  display: flex; flex-direction: column;
  gap: 14px;
  min-height: 280px;
  transition: background 0.25s var(--ease), transform 0.25s var(--ease);
  position: relative;
  overflow: hidden;
}
.aff-card::after {
  content: '→';
  position: absolute;
  top: 32px; right: 32px;
  color: var(--gold);
  font-size: 1.1rem;
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
}
.aff-card:hover { background: var(--bg-2); }
.aff-card:hover::after { opacity: 1; transform: translateX(0); }
.aff-card-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 14px;
}
.aff-card-name {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.aff-card-tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  padding: 5px 11px;
  white-space: nowrap;
  border-radius: 999px;
}
.aff-card-bonus {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.1rem;
  color: var(--text);
  padding: 14px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.aff-card-note { color: var(--text-2); font-size: 0.92rem; flex: 1; line-height: 1.6; }

/* ═══════════════════════════════════════════════════════════
   PAGE HEADER
   ═══════════════════════════════════════════════════════════ */

.page-header {
  padding: 96px 32px 64px;
  border-bottom: 1px solid var(--line);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.page-header::after {
  content: '';
  position: absolute; left: 50%; top: 0;
  transform: translateX(-50%);
  width: 800px; height: 300px;
  background: radial-gradient(ellipse at center, var(--gold-soft), transparent 65%);
  pointer-events: none;
}
.page-header .kicker { margin-bottom: 18px; display: inline-block; position: relative; }
.page-header h1 { margin-bottom: 18px; position: relative; text-wrap: balance; }
.page-header p {
  max-width: 640px; margin: 0 auto;
  color: var(--text-2);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.22rem;
  position: relative;
  text-wrap: pretty;
}

/* ═══════════════════════════════════════════════════════════
   CALCULATOR
   ═══════════════════════════════════════════════════════════ */

.calc-tabs {
  display: flex; justify-content: center; gap: 0;
  margin: 36px auto 0;
  max-width: 1080px;
  border-bottom: 1px solid var(--line);
}
.calc-tab {
  padding: 18px 30px;
  background: none;
  color: var(--text-3);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-family: var(--mono);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s var(--ease);
  font-weight: 500;
}
.calc-tab.active { color: var(--gold); border-bottom-color: var(--gold); }
.calc-tab:hover { color: var(--text-2); }

.calc-wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 48px 32px 80px;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 1px;
  background: var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  margin-top: 32px;
}
@media (max-width: 880px) {
  .calc-wrap { grid-template-columns: 1fr; padding: 32px 16px 64px; }
}
.calc-form, .calc-results {
  background: var(--bg);
  padding: 36px;
  display: flex; flex-direction: column;
  gap: 20px;
}
.calc-results { min-height: 380px; }
.calc-form h2 {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin-bottom: 6px;
  letter-spacing: -0.015em;
}

.field { display: flex; flex-direction: column; gap: 8px; }
.field label {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.16em;
}
.field input, .field select {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  padding: 13px 14px;
  font-family: var(--sans);
  font-size: 0.98rem;
  color: var(--text);
  outline: none;
  border-radius: var(--radius-sm);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease), background 0.18s var(--ease);
}
.field input:hover, .field select:hover { border-color: var(--line-2); }
.field input:focus, .field select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft);
  background: var(--bg);
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.calc-empty {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  color: var(--text-3);
  gap: 14px;
}
.calc-empty-icon {
  font-family: var(--serif);
  font-size: 2.6rem;
  color: var(--gold);
  font-style: italic;
  width: 64px; height: 64px;
  border: 1px solid var(--gold-line);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--gold-soft);
}
.calc-empty p { font-family: var(--serif); font-style: italic; font-size: 1.15rem; color: var(--text-2); }

.calc-summary {
  padding: 28px;
  border: 1px solid var(--gold-line);
  background: linear-gradient(135deg, var(--gold-soft), transparent 70%);
  border-radius: var(--radius);
  position: relative;
  overflow: hidden;
}
.calc-summary::after {
  content: '';
  position: absolute;
  top: -50%; right: -20%;
  width: 240px; height: 240px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--gold-glow), transparent 60%);
  pointer-events: none;
}
.calc-summary .kicker { margin-bottom: 10px; display: block; position: relative; }
.calc-summary-amount {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 5vw, 3.2rem);
  font-weight: 500;
  line-height: 1.05;
  color: var(--gold);
  letter-spacing: -0.025em;
  margin-bottom: 8px;
  position: relative;
}
.calc-summary-sub { color: var(--text-2); font-size: 0.92rem; position: relative; }

.calc-table { width: 100%; border-collapse: collapse; }
.calc-table th, .calc-table td {
  padding: 14px 16px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.calc-table th {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-3);
  font-weight: 500;
  border-bottom-color: var(--line-2);
  padding-bottom: 10px;
}
.calc-table .num { text-align: right; color: var(--text-2); font-family: var(--mono); }
.calc-table tbody tr { transition: background .15s var(--ease); }
.calc-table tbody tr:hover { background: rgba(255,255,255,.015); }
.calc-table tr.winner td {
  background: var(--gold-soft);
  color: var(--text);
}
.calc-table tr.winner td:first-child { position: relative; }
.calc-table tr.winner td:first-child::before {
  content: '★';
  color: var(--gold);
  margin-right: 8px;
  font-size: 0.85rem;
}
.calc-table tr.winner .num { color: var(--gold); font-weight: 600; }

.calc-cta {
  padding: 22px;
  border: 1px solid var(--line);
  background: var(--bg-2);
  display: flex; gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  border-radius: var(--radius);
}
.calc-cta-text { flex: 1; min-width: 200px; }
.calc-cta-text strong {
  font-family: var(--serif);
  font-size: 1.15rem;
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-weight: 500;
}
.calc-cta-text p { font-size: 0.88rem; color: var(--text-2); }

.calc-detail {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.calc-detail-tile {
  background: var(--bg);
  padding: 22px;
  transition: background .2s var(--ease);
}
.calc-detail-tile:hover { background: var(--bg-2); }
.calc-detail-lab {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--text-3);
  margin-bottom: 10px;
}
.calc-detail-val {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
  color: var(--text);
  letter-spacing: -0.015em;
}
.calc-detail-val.gold { color: var(--gold); }
.calc-detail-val.green { color: var(--green); }

.market-strip {
  max-width: 1080px;
  margin: 0 auto;
  padding: 20px 32px 0;
  display: flex; flex-wrap: wrap; gap: 22px;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--text-3);
}
.market-strip span b { color: var(--gold); font-weight: 500; }

/* ═══════════════════════════════════════════════════════════
   BROKERS RANKING
   ═══════════════════════════════════════════════════════════ */

.rank-list { max-width: 960px; margin: 0 auto; padding: 56px 32px; }
.rank-row {
  padding: 36px 24px;
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 32px;
  align-items: center;
  transition: background 0.25s var(--ease);
  border-radius: var(--radius-sm);
}
.rank-row:first-child { border-top: 1px solid var(--line); }
.rank-row:hover { background: var(--bg-2); }
.rank-row.featured .rank-num { color: var(--gold); }
.rank-num {
  font-family: var(--serif);
  font-size: 3.4rem;
  font-weight: 500;
  line-height: 1;
  color: var(--text-3);
  font-style: italic;
  letter-spacing: -0.03em;
}
.rank-info h3 {
  font-family: var(--serif);
  font-size: 1.9rem;
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.rank-info p { color: var(--text-2); margin-bottom: 14px; line-height: 1.6; }
.rank-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.rank-tag {
  font-family: var(--mono);
  font-size: 0.66rem;
  padding: 4px 10px;
  border: 1px solid var(--line-2);
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border-radius: 999px;
}
.rank-tag.good { color: var(--gold); border-color: var(--gold-line); background: var(--gold-soft); }
.rank-tag.warn { color: var(--text-2); border-color: var(--line-2); }
.rank-tag.bad  { color: var(--red); border-color: rgba(224,132,132,.4); background: rgba(224,132,132,.06); }
@media (max-width: 600px) {
  .rank-row { grid-template-columns: 1fr; gap: 14px; padding: 28px 16px; }
}

/* ═══════════════════════════════════════════════════════════
   FISCAL
   ═══════════════════════════════════════════════════════════ */

.fiscal-grid {
  max-width: 1080px;
  margin: 0 auto;
  padding: 56px 32px;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
@media (max-width: 800px) { .fiscal-grid { grid-template-columns: 1fr; } }
.fiscal-card { background: var(--bg); padding: 36px; transition: background .25s var(--ease); }
.fiscal-card:hover { background: var(--bg-2); }
.fiscal-card .kicker { display: block; margin-bottom: 14px; }
.fiscal-card h3 {
  font-family: var(--serif);
  font-size: 1.5rem;
  margin-bottom: 14px;
  font-weight: 500;
  letter-spacing: -0.015em;
}
.fiscal-card p { color: var(--text-2); margin-bottom: 12px; font-size: 0.96rem; line-height: 1.65; }
.fiscal-card ul { list-style: none; padding: 0; margin: 14px 0; }
.fiscal-card li {
  color: var(--text-2);
  padding: 8px 0;
  font-size: 0.94rem;
  border-bottom: 1px solid var(--line);
  display: flex; justify-content: space-between; gap: 14px;
}
.fiscal-card li:last-child { border-bottom: 0; }
.fiscal-card strong {
  color: var(--gold);
  font-weight: 500;
  font-family: var(--mono);
}

.banner-cta {
  max-width: 1080px;
  margin: 0 auto 80px;
  padding: 52px;
  background:
    radial-gradient(ellipse at top left, var(--gold-soft), transparent 60%),
    linear-gradient(135deg, var(--surface), var(--bg-2));
  border: 1px solid var(--gold-line);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  align-items: center;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.banner-cta h3 {
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 500;
  margin-bottom: 10px;
  color: var(--text);
  letter-spacing: -0.015em;
}
.banner-cta p { color: var(--text-2); margin: 0; }
@media (max-width: 700px) {
  .banner-cta { grid-template-columns: 1fr; padding: 32px; }
}

/* ═══════════════════════════════════════════════════════════
   AUTH
   ═══════════════════════════════════════════════════════════ */

.auth-page {
  display: flex; align-items: center; justify-content: center;
  min-height: calc(100vh - 80px);
  padding: 48px 32px;
  position: relative;
}
.auth-page::before {
  content: '';
  position: absolute; inset: 0;
  background: radial-gradient(ellipse at center, var(--gold-soft), transparent 60%);
  pointer-events: none;
}
.auth-card {
  width: 100%;
  max-width: 460px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 48px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  position: relative;
  z-index: 1;
}
.auth-head { text-align: center; margin-bottom: 32px; }
.auth-mark {
  width: 52px; height: 52px;
  border: 1px solid var(--gold);
  color: var(--gold);
  margin: 0 auto 22px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--serif);
  font-size: 1.35rem;
  border-radius: var(--radius);
  background: var(--gold-soft);
  box-shadow: 0 0 0 6px var(--gold-soft);
}
.auth-head h1 { font-family: var(--serif); font-size: 1.9rem; margin-bottom: 10px; letter-spacing: -0.015em; }
.auth-head p { color: var(--text-3); font-family: var(--serif); font-style: italic; font-size: 1.05rem; }

.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-bottom: 1px solid var(--line);
  margin-bottom: 28px;
}
.auth-tabs button {
  padding: 14px;
  background: transparent;
  color: var(--text-3);
  font-family: var(--mono);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.2s var(--ease);
  cursor: pointer;
}
.auth-tabs button:hover { color: var(--text-2); }
.auth-tabs button.active { color: var(--gold); border-bottom-color: var(--gold); }

.auth-msg {
  padding: 12px 14px;
  border: 1px solid;
  font-size: 0.9rem;
  margin-bottom: 16px;
  display: none;
  font-family: var(--sans);
  border-radius: var(--radius-sm);
}
.auth-msg.show { display: block; }
.auth-msg.err { color: var(--red); border-color: var(--red); background: rgba(224,132,132,.08); }
.auth-msg.ok  { color: var(--green); border-color: var(--green); background: rgba(132,199,154,.08); }

.auth-perks {
  margin-top: 24px;
  padding: 20px;
  background: var(--gold-soft);
  border: 1px solid var(--gold-line);
  border-radius: var(--radius);
}
.auth-perks-title {
  font-family: var(--mono);
  font-size: 0.66rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold);
  margin-bottom: 14px;
}
.auth-perks ul { list-style: none; padding: 0; margin: 0; }
.auth-perks li {
  color: var(--text-2);
  padding: 5px 0;
  font-size: 0.9rem;
  display: flex; gap: 10px;
  align-items: baseline;
}
.auth-perks li::before { content: '—'; color: var(--gold); }

.auth-foot { text-align: center; margin-top: 20px; font-size: 0.86rem; color: var(--text-3); }

.spinner {
  display: inline-block;
  width: 14px; height: 14px;
  border: 2px solid rgba(10, 14, 26, 0.3);
  border-top-color: var(--bg);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ═══════════════════════════════════════════════════════════
   CHAT
   ═══════════════════════════════════════════════════════════ */

.chat-page {
  max-width: 920px;
  margin: 0 auto;
  height: calc(100vh - 81px);
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  background: var(--bg);
}
.chat-head {
  border-bottom: 1px solid var(--line);
  padding: 20px 28px;
  display: flex; align-items: center; gap: 16px;
  background: linear-gradient(180deg, var(--bg-2), transparent);
}
.chat-head-icon {
  width: 44px; height: 44px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--serif);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.95rem;
  border-radius: var(--radius);
  background: var(--gold-soft);
}
.chat-head h2 { font-family: var(--serif); font-size: 1.25rem; margin: 0; font-weight: 500; }
.chat-head .kicker { font-size: 0.62rem; display: block; margin-bottom: 4px; }
.chat-credits {
  margin-left: auto;
  display: flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.chat-credits b { color: var(--gold); font-size: 1.1rem; font-weight: 500; }

.chat-body {
  overflow-y: auto;
  padding: 36px;
  display: flex; flex-direction: column;
  gap: 22px;
}

.chat-welcome { text-align: center; margin: auto; max-width: 580px; }
.chat-welcome-mark {
  width: 64px; height: 64px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--serif);
  font-size: 1.5rem;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 24px;
  border-radius: var(--radius);
  background: var(--gold-soft);
  box-shadow: 0 0 0 6px var(--gold-soft);
}
.chat-welcome h3 { font-family: var(--serif); font-size: 1.8rem; margin-bottom: 12px; letter-spacing: -0.015em; }
.chat-welcome p {
  color: var(--text-2);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.08rem;
}
.chat-suggest {
  display: flex; flex-wrap: wrap; gap: 10px;
  justify-content: center;
  margin-top: 30px;
}
.chat-suggest button {
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 10px 16px;
  font-size: 0.86rem;
  color: var(--text-2);
  font-family: var(--sans);
  cursor: pointer;
  border-radius: 999px;
  transition: all 0.2s var(--ease);
}
.chat-suggest button:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-soft);
}

.chat-msg { display: flex; gap: 14px; max-width: 92%; }
.chat-msg.user { flex-direction: row-reverse; align-self: flex-end; }
.chat-avatar {
  width: 34px; height: 34px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  border-radius: var(--radius-sm);
}
.chat-msg.assistant .chat-avatar { border: 1px solid var(--gold); color: var(--gold); background: var(--gold-soft); }
.chat-msg.user .chat-avatar {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.chat-bubble {
  padding: 14px 18px;
  font-size: 0.96rem;
  line-height: 1.65;
  word-break: break-word;
  border-radius: var(--radius);
}
.chat-msg.assistant .chat-bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text);
  border-top-left-radius: var(--radius-sm);
}
.chat-msg.user .chat-bubble {
  background: linear-gradient(135deg, var(--gold-soft), rgba(212,173,106,.05));
  border: 1px solid var(--gold-line);
  color: var(--text);
  border-top-right-radius: var(--radius-sm);
}
.chat-bubble p { margin-bottom: 0.6em; color: inherit; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble strong { color: var(--gold); font-weight: 500; }
.chat-bubble code {
  font-family: var(--mono);
  background: rgba(255, 255, 255, 0.05);
  padding: 2px 6px;
  font-size: 0.85em;
  border-radius: 3px;
}
.chat-bubble ul { padding-left: 20px; margin: 6px 0; }
.chat-bubble li { margin-bottom: 4px; }

.chat-aff-list { display: flex; flex-direction: column; gap: 8px; margin-top: 14px; }
.chat-aff {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px;
  background: var(--bg-2);
  border: 1px solid var(--gold-line);
  text-decoration: none;
  color: var(--text);
  border-radius: var(--radius-sm);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.chat-aff:hover {
  background: var(--surface);
  border-color: var(--gold);
  color: var(--text);
  text-decoration: none;
  transform: translateX(2px);
}
.chat-aff-icon {
  width: 36px; height: 36px;
  border: 1px solid var(--gold);
  color: var(--gold);
  font-family: var(--mono);
  font-weight: 600;
  font-size: 0.78rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  border-radius: var(--radius-sm);
  background: var(--gold-soft);
}
.chat-aff-body { flex: 1; min-width: 0; }
.chat-aff-name { font-family: var(--serif); font-size: 1.08rem; font-weight: 500; }
.chat-aff-bonus { font-size: 0.82rem; color: var(--text-3); margin-top: 1px; }
.chat-aff-arrow { color: var(--gold); font-size: 1.2rem; }

.chat-typing { display: inline-flex; gap: 5px; padding: 4px 0; align-items: center; }
.chat-typing span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--gold);
  animation: blink 1.2s infinite;
}
.chat-typing span:nth-child(2) { animation-delay: 0.15s; }
.chat-typing span:nth-child(3) { animation-delay: 0.3s; }
@keyframes blink {
  0%, 80%, 100% { opacity: 0.3; transform: scale(.85); }
  40% { opacity: 1; transform: scale(1); }
}

.chat-input-wrap {
  border-top: 1px solid var(--line);
  padding: 18px 28px 22px;
  background: var(--bg);
}
.chat-no-credits {
  background: rgba(224, 132, 132, 0.08);
  border: 1px solid var(--red);
  padding: 12px 14px;
  margin-bottom: 12px;
  display: none;
  align-items: center; gap: 12px;
  border-radius: var(--radius-sm);
}
.chat-no-credits.show { display: flex; }
.chat-no-credits-text { flex: 1; font-size: 0.9rem; color: var(--text); }
.chat-no-credits-text b { color: var(--red); }

.chat-input-shell {
  display: flex; align-items: flex-end; gap: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: 8px 8px 8px 16px;
  border-radius: var(--radius);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}
.chat-input-shell:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px var(--gold-soft);
}
.chat-input-shell.disabled { opacity: 0.5; pointer-events: none; }
.chat-input-shell textarea {
  flex: 1;
  background: transparent;
  border: 0; outline: none; resize: none;
  font-family: var(--sans);
  font-size: 0.96rem;
  color: var(--text);
  padding: 10px 0;
  max-height: 160px;
  line-height: 1.5;
}
.chat-input-shell textarea::placeholder { color: var(--text-3); }
.chat-send {
  width: 40px; height: 40px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--bg);
  display: flex; align-items: center; justify-content: center;
  transition: all 0.18s var(--ease);
  cursor: pointer;
  border: 0;
  border-radius: var(--radius-sm);
  box-shadow: 0 2px 8px rgba(212,173,106,.25);
}
.chat-send:hover:not(:disabled) {
  background: linear-gradient(180deg, #f1d293, var(--gold-2));
  box-shadow: 0 4px 14px rgba(212,173,106,.4);
}
.chat-send:disabled {
  background: var(--line-2);
  color: var(--text-3);
  cursor: not-allowed;
  box-shadow: none;
}
.chat-hint {
  font-family: var(--mono);
  font-size: 0.66rem;
  color: var(--text-3);
  text-align: center;
  margin-top: 12px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.chat-locked {
  text-align: center;
  padding: 80px 32px;
  max-width: 520px;
  margin: 0 auto;
}
.chat-locked .auth-mark { margin-bottom: 24px; }
.chat-locked h2 { font-family: var(--serif); margin-bottom: 14px; letter-spacing: -0.015em; }
.chat-locked p { color: var(--text-2); margin-bottom: 24px; }

/* ═══════════════════════════════════════════════════════════
   PRICING (créditos)
   ═══════════════════════════════════════════════════════════ */

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1px;
  background: var(--line);
  max-width: 720px;
  margin: 0 auto;
  border-radius: var(--radius);
  overflow: hidden;
}
@media (max-width: 600px) { .pricing-grid { grid-template-columns: 1fr; } }
.price-card {
  background: var(--bg);
  padding: 36px;
  display: flex; flex-direction: column;
  gap: 14px;
  position: relative;
  transition: background .25s var(--ease);
}
.price-card:hover { background: var(--bg-2); }
.price-card.featured {
  background:
    radial-gradient(ellipse at top, var(--gold-glow), transparent 60%),
    var(--gold-soft);
}
.price-card.featured::before {
  content: 'Mejor valor';
  position: absolute;
  top: 14px; right: 14px;
  background: linear-gradient(180deg, var(--gold-2), var(--gold));
  color: var(--bg);
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  padding: 5px 11px;
  font-weight: 600;
  border-radius: 999px;
}
.price-name { font-family: var(--serif); font-size: 1.6rem; font-weight: 500; letter-spacing: -0.015em; }
.price-amount {
  font-family: var(--serif);
  font-size: 2.6rem;
  font-weight: 500;
  line-height: 1;
  color: var(--gold);
  letter-spacing: -0.025em;
}
.price-amount small {
  font-size: 0.9rem;
  color: var(--text-3);
  margin-left: 6px;
  font-weight: 400;
}
.price-detail {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--text-3);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

/* ═══════════════════════════════════════════════════════════
   FOOTER
   ═══════════════════════════════════════════════════════════ */

.ib-foot {
  border-top: 1px solid var(--line);
  padding: 56px 32px;
  background: var(--bg-2);
  position: relative;
}
.ib-foot::before {
  content: '';
  position: absolute;
  top: 0; left: 50%;
  transform: translateX(-50%);
  width: 300px; height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: .5;
}
.ib-foot-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: 48px;
}
.ib-foot-disclaimer { font-size: 0.84rem; color: var(--text-3); line-height: 1.65; }
.ib-foot-disclaimer strong {
  color: var(--gold);
  font-weight: 500;
  font-family: var(--mono);
  text-transform: uppercase;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  display: block;
  margin-bottom: 10px;
}
.ib-foot-links {
  display: flex; flex-wrap: wrap; gap: 10px 24px;
  font-family: var(--mono);
  font-size: 0.78rem;
  justify-content: flex-end;
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.ib-foot-links a { color: var(--text-3); transition: color .15s var(--ease); }
.ib-foot-links a:hover { color: var(--gold); }
@media (max-width: 700px) {
  .ib-foot-inner { grid-template-columns: 1fr; }
  .ib-foot-links { justify-content: flex-start; }
}

/* ═══════════════════════════════════════════════════════════
   TOAST
   ═══════════════════════════════════════════════════════════ */

.ib-toasts {
  position: fixed; bottom: 24px; right: 24px;
  display: flex; flex-direction: column; gap: 10px;
  z-index: 200;
  pointer-events: none;
}
.ib-toast {
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  color: var(--text);
  padding: 14px 20px;
  font-size: 0.9rem;
  max-width: 360px;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.24s var(--ease), transform 0.24s var(--ease);
  pointer-events: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.ib-toast.show { opacity: 1; transform: translateY(0); }
.ib-toast-err { border-left-color: var(--red); }
.ib-toast-ok  { border-left-color: var(--green); }

/* ═══════════════════════════════════════════════════════════
   COOKIE BANNER
   ═══════════════════════════════════════════════════════════ */

.cookie-bar {
  position: fixed; bottom: 16px; left: 16px; right: 16px;
  background: var(--surface);
  border: 1px solid var(--gold-line);
  padding: 20px 24px;
  z-index: 150;
  display: none;
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}
.cookie-bar.show { display: block; }
.cookie-bar-inner {
  max-width: var(--max);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}
.cookie-text {
  font-size: 0.88rem;
  color: var(--text-2);
  line-height: 1.55;
}
.cookie-text a { color: var(--gold); text-decoration: underline; }
.cookie-actions { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 700px) {
  .cookie-bar-inner { grid-template-columns: 1fr; }
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE NAV
   ═══════════════════════════════════════════════════════════ */

@media (max-width: 880px) {
  .ib-nav-inner { padding: 14px 20px; gap: 14px; }
  .ib-nav-links {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: 8px;
    display: none;
    margin: 0;
    box-shadow: var(--shadow);
  }
  .ib-nav-links.open { display: flex; animation: fadeDown .2s var(--ease); }
  .ib-nav-links a { padding: 14px 18px; font-size: 1rem; border-radius: var(--radius-sm); }
  .ib-burger { display: flex; }
  .ib-pill-email { display: none; }
  .ib-nav-cta { gap: 6px; margin-left: auto; }
}

/* ── Mobile narrow: condensa el header perquè els botons login/signup
      no se surtin de la pantalla ───────────────────────────────── */
@media (max-width: 560px) {
  .ib-brand span:not(.ib-mark) { display: none; }   /* deixa només el quadrat IB */
  .ib-nav-inner { padding: 12px 16px; gap: 10px; }
  .ib-nav-cta .ib-btn-sm { padding: 7px 11px; font-size: 0.78rem; }
  .theme-toggle { width: 34px; height: 34px; }
  .ib-burger { padding: 6px; }
}
@media (max-width: 400px) {
  .ib-nav-cta #ib-nav-guest .ib-btn:not(.ib-btn-primary) { display: none; } /* només "Crear cuenta" en mòbils petits */
  .ib-nav-cta .ib-btn-sm { padding: 7px 10px; font-size: 0.76rem; }
}

@media (max-width: 600px) {
  .section { padding: 64px 20px; }
  .hero { padding: 64px 20px 48px; }
  .container, .container-narrow { padding: 0 20px; }
  .hero-side { padding: 26px; }
  .hero-stats { gap: 18px; }
  .hero-stat-num { font-size: 2rem; }
  .auth-page { padding: 32px 16px; }
  .auth-card { padding: 30px 22px; }
  .calc-form, .calc-results { padding: 24px 20px; }
  .calc-detail { grid-template-columns: 1fr; }
  .feat { padding: 32px 26px; min-height: 0; }
  .aff-card { padding: 26px 22px; min-height: 0; }
  .fiscal-card { padding: 28px 22px; }
  .banner-cta { padding: 28px 22px; }
  .ib-foot { padding: 40px 20px; }
  .market-strip { padding: 16px 20px 0; gap: 14px; }
  .calc-tab { padding: 14px 16px; font-size: 0.72rem; letter-spacing: 0.12em; }
}

/* ── Anti-overflow guards: cap descendent pot superar el viewport ── */
img, svg, video, canvas, iframe { max-width: 100%; height: auto; }
.hero, .section, .page-header, .auth-page, .chat-page { max-width: 100%; }
.hero-inner, .ib-foot-inner, .calc-wrap, .fiscal-grid, .rank-list, .aff-grid, .pricing-grid { max-width: min(var(--max), 100%); }
.ib-toasts { left: auto; right: 16px; max-width: calc(100vw - 32px); }
.ib-toast { max-width: min(360px, calc(100vw - 48px)); }
.cookie-bar { left: 12px; right: 12px; max-width: calc(100vw - 24px); }
.chat-bubble { max-width: 100%; overflow-wrap: anywhere; }
.chat-msg { max-width: min(92%, calc(100vw - 56px)); }
