/* MTEX Holding — reuses the broker's palette tokens, fonts and card idiom.
   Colours mirror src/frontend/src/index.css: white/blue platform with an
   emerald accent; primary oklch(0.52 0.22 264), accent oklch(0.64 0.17 164). */
:root {
  --bg: oklch(0.98 0 0);
  --fg: oklch(0.13 0.01 264);
  --card: oklch(1 0 0);
  --muted: oklch(0.96 0.005 264);
  --muted-fg: oklch(0.5 0.01 264);
  --border: oklch(0.91 0.005 264);
  --primary: oklch(0.52 0.22 264);
  --accent: oklch(0.64 0.17 164);
  --gold: oklch(0.8 0.15 85);
  --ink: oklch(0.13 0.01 264);
  --radius: 0.75rem;
  --shadow: 0 10px 30px -12px rgba(15, 23, 42, 0.25);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Plus Jakarta Sans", system-ui, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.55;
}
h1, h2, h3, h4 { font-family: "Bricolage Grotesque", "Plus Jakarta Sans", sans-serif; letter-spacing: -0.01em; }
a { color: inherit; text-decoration: none; }

/* ---------- top bar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 24px; max-width: 1120px; margin: 0 auto;
}
.brand { display: flex; align-items: center; gap: 10px; }
.brand-center { justify-content: center; margin-bottom: 18px; }
.brand-logo { width: 34px; height: 34px; border-radius: 9px; object-fit: cover; box-shadow: var(--shadow); }
.brand-logo.sm { width: 24px; height: 24px; }
.brand-name { font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: 20px; }
.brand-name.sm { font-size: 15px; }
.brand-accent { color: var(--accent); }
.topnav { display: flex; align-items: center; gap: 22px; }
.topnav a { color: var(--muted-fg); font-weight: 500; font-size: 15px; }
.topnav a:hover { color: var(--fg); }

/* ---------- buttons ---------- */
.btn {
  font: inherit; font-weight: 600; border: 0; border-radius: var(--radius);
  padding: 11px 18px; cursor: pointer; transition: transform .05s ease, filter .15s ease, background .15s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost { background: transparent; border: 1px solid var(--border); color: var(--fg); }
.btn-ghost:hover { background: var(--muted); }
.btn-block { width: 100%; margin-top: 6px; }
.btn-link { background: none; color: var(--muted-fg); padding: 8px; width: 100%; font-weight: 500; }
.btn-link:hover { color: var(--fg); }

/* ---------- hero ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 80% -10%, oklch(0.64 0.17 164 / 0.18), transparent),
    linear-gradient(180deg, oklch(0.145 0 0), oklch(0.2 0.02 264));
  color: #fff; border-radius: 0 0 28px 28px;
}
.hero-inner { max-width: 820px; margin: 0 auto; padding: 56px 24px 64px; text-align: center; }
.pill {
  display: inline-block; font-size: 13px; font-weight: 600; color: oklch(0.86 0.06 164);
  background: oklch(0.64 0.17 164 / 0.14); border: 1px solid oklch(0.64 0.17 164 / 0.35);
  padding: 6px 14px; border-radius: 999px; margin-bottom: 20px;
}
.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.05; margin: 0 0 18px; }
.grad { background: linear-gradient(90deg, oklch(0.72 0.17 164), oklch(0.7 0.15 264)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lede { font-size: 18px; color: oklch(0.85 0.01 264); max-width: 640px; margin: 0 auto 28px; }
.lede strong { color: #fff; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.hero-cta .btn-ghost { color: #fff; border-color: rgba(255,255,255,0.25); }
.hero-cta .btn-ghost:hover { background: rgba(255,255,255,0.08); }
.hero-stats { display: flex; gap: 36px; justify-content: center; flex-wrap: wrap; margin-top: 40px; }
.hero-stats div { display: flex; flex-direction: column; }
.hero-stats strong { font-size: 24px; font-family: "Bricolage Grotesque", sans-serif; }
.hero-stats span { font-size: 13px; color: oklch(0.75 0.01 264); }

/* ---------- sections ---------- */
.section { max-width: 1120px; margin: 0 auto; padding: 64px 24px; }
.section-muted { background: var(--muted); border-radius: 24px; margin-top: 24px; }
.section-title { text-align: center; font-size: clamp(26px, 3.5vw, 36px); margin: 0 0 40px; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }
.card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 28px; box-shadow: var(--shadow);
}
.card h3 { margin: 14px 0 8px; font-size: 19px; }
.card p { margin: 0; color: var(--muted-fg); }
.card-ico {
  width: 48px; height: 48px; border-radius: 12px; display: grid; place-items: center;
  font-size: 24px; font-weight: 700; color: var(--primary); background: oklch(0.52 0.22 264 / 0.12);
}
.card-ico.gold { color: oklch(0.55 0.13 85); background: oklch(0.8 0.15 85 / 0.2); }

.steps { list-style: none; margin: 0 auto; padding: 0; max-width: 720px; display: grid; gap: 20px; }
.steps li { display: flex; gap: 18px; align-items: flex-start; }
.step-n {
  flex: none; width: 36px; height: 36px; border-radius: 999px; background: var(--primary); color: #fff;
  display: grid; place-items: center; font-weight: 700;
}
.steps h4 { margin: 2px 0 4px; font-size: 18px; }
.steps p { margin: 0; color: var(--muted-fg); }

/* ---------- modal ---------- */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, 0.55);
  display: grid; place-items: center; padding: 20px; z-index: 50;
}
.modal {
  position: relative; background: var(--card); border-radius: 18px; box-shadow: var(--shadow);
  padding: 32px 28px; width: 100%; max-width: 400px;
}
.modal-close {
  position: absolute; top: 12px; right: 14px; background: none; border: 0;
  font-size: 26px; line-height: 1; color: var(--muted-fg); cursor: pointer;
}
.auth-form h2 { margin: 0 0 6px; font-size: 22px; text-align: center; }
.auth-sub { margin: 0 0 20px; color: var(--muted-fg); font-size: 14px; text-align: center; }
.auth-form label { display: block; font-size: 13px; font-weight: 600; margin: 0 0 6px; color: var(--muted-fg); }
.auth-form input {
  width: 100%; font: inherit; padding: 12px 14px; border: 1px solid var(--border);
  border-radius: var(--radius); margin-bottom: 14px; background: var(--bg);
}
.auth-form input:focus { outline: 2px solid oklch(0.52 0.22 264 / 0.4); border-color: var(--primary); }
#code { text-align: center; letter-spacing: 10px; font-size: 22px; font-weight: 700; }
.auth-msg { min-height: 18px; margin: 10px 0 0; font-size: 13px; text-align: center; }
.auth-msg.error { color: oklch(0.55 0.22 27); }
.auth-msg.ok { color: var(--accent); }

/* ---------- profile ---------- */
.profile-wrap { max-width: 720px; margin: 0 auto; padding: 48px 24px 72px; }
.profile-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.profile-hello { margin: 0; color: var(--muted-fg); font-size: 13px; }
.profile-head h1 { margin: 2px 0 0; font-size: 22px; word-break: break-all; }
.balance-card {
  background: linear-gradient(180deg, oklch(0.145 0 0), oklch(0.22 0.03 264));
  color: #fff; border-radius: 20px; padding: 32px; box-shadow: var(--shadow);
}
.balance-label { margin: 0 0 6px; color: oklch(0.8 0.01 264); font-size: 14px; }
.balance-value { margin: 0; font-family: "Bricolage Grotesque", sans-serif; font-weight: 800; font-size: clamp(36px, 7vw, 52px); }
.status-row { display: flex; align-items: center; gap: 12px; margin-top: 16px; flex-wrap: wrap; }
.badge {
  display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 13px;
  padding: 6px 12px; border-radius: 999px;
}
.badge.gold { background: oklch(0.8 0.15 85 / 0.25); color: oklch(0.88 0.14 85); border: 1px solid oklch(0.8 0.15 85 / 0.5); }
.badge.standard { background: rgba(255,255,255,0.1); color: oklch(0.85 0.01 264); border: 1px solid rgba(255,255,255,0.2); }
.status-note { color: oklch(0.8 0.01 264); font-size: 13px; }

.profile-benefits { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-top: 24px; }
.pb { display: flex; gap: 12px; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.pb-ico { width: 40px; height: 40px; flex: none; border-radius: 10px; display: grid; place-items: center; font-size: 20px; font-weight: 700; color: var(--primary); background: oklch(0.52 0.22 264 / 0.12); }
.pb-ico.gold { color: oklch(0.55 0.13 85); background: oklch(0.8 0.15 85 / 0.2); }
.pb div { display: flex; flex-direction: column; }
.pb strong { font-size: 14px; }
.pb span { font-size: 13px; color: var(--muted-fg); }

/* ---------- footer ---------- */
.footer { border-top: 1px solid var(--border); margin-top: 40px; padding: 28px 24px; text-align: center; color: var(--muted-fg); }
.footer .brand { justify-content: center; margin-bottom: 8px; }
.footer p { margin: 0; font-size: 13px; }

@media (max-width: 560px) {
  .topnav a { display: none; }
  .hero-stats { gap: 24px; }
}

/* The [hidden] attribute must always win: .modal-backdrop (display:flex) and others overrode it,
   so the login box stayed on screen after a successful sign-in (2026-10-04). */
[hidden] { display: none !important; }
