:root {
  --bg: #0E0F13;
  --card-bg: #161A1F;
  --oracle-blue: #1EA7E1;
  --accent: #00E5FF;
  --text-primary: #EDEDED;
  --text-secondary: #A0A6AD;
  --muted: #5A5F66;
  --profit: #4CAF50;
  --border-soft: rgba(160, 166, 173, 0.16);
  --border-strong: rgba(30, 167, 225, 0.32);
  --card-shadow: 0 12px 32px rgba(0, 0, 0, 0.22);
  --card-glow: 0 0 0 1px rgba(30, 167, 225, 0.16), 0 16px 40px rgba(30, 167, 225, 0.08);
  --site-width: 1200px;
  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --header-height: 72px;
}

@font-face {
  font-family: "Inter";
  src: url("../assets/fonts/Inter-VariableFont_opsz_wght.ttf") format("truetype");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

* { box-sizing: border-box; }
.hidden { display: none !important; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  font-family: "Inter", system-ui, sans-serif;
  line-height: 1.6;
  color: var(--text-primary);
  background:
    radial-gradient(circle at top left, rgba(30, 167, 225, 0.14), transparent 34%),
    radial-gradient(circle at top right, rgba(0, 229, 255, 0.06), transparent 24%),
    var(--bg);
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul { margin: 0; }
ul { list-style: none; padding: 0; }

.container {
  width: min(100% - 32px, var(--site-width));
  margin: 0 auto;
}

/* ─── Header ───────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: var(--header-height);
  backdrop-filter: blur(18px);
  background: rgba(14, 15, 19, 0.82);
  border-bottom: 1px solid rgba(160, 166, 173, 0.08);
}

.header-inner {
  min-height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo {
  height: 42px;
  width: auto;
  mix-blend-mode: screen;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: var(--text-secondary);
}

.site-nav a { transition: color 0.2s ease; }
.site-nav a:hover { color: var(--text-primary); }
.nav-cta { color: var(--oracle-blue); font-weight: 700; }

/* ─── Hero ─────────────────────────────── */
.hero-section {
  padding: 88px 0 64px;
  text-align: center;
}

.hero-title {
  font-size: clamp(2.8rem, 6vw, 4.8rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  max-width: 18ch;
  margin: 0 auto;
}

.hero-title span { color: var(--oracle-blue); }

.hero-text {
  max-width: 64ch;
  margin: 20px auto 0;
  font-size: 1.15rem;
  color: var(--text-secondary);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 14px;
  margin-top: 32px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 1rem;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
  border: none;
  cursor: pointer;
}

.button:hover { transform: translateY(-1px); }

.button-primary {
  background: linear-gradient(135deg, rgba(30, 167, 225, 0.26), rgba(0, 229, 255, 0.18));
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  box-shadow: var(--card-glow);
}

.button-secondary {
  background: rgba(255, 255, 255, 0.02);
  color: var(--text-primary);
  border: 1px solid var(--border-soft);
}

/* ─── Sections ─────────────────────────── */
.section {
  padding: 72px 0;
}

.section-kicker {
  margin-bottom: 12px;
  color: var(--oracle-blue);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-title {
  font-size: clamp(2rem, 4vw, 3.2rem);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.03em;
}

.section-title span { color: var(--oracle-blue); }

.section-lead {
  max-width: 68ch;
  margin-top: 16px;
  color: var(--text-secondary);
  font-size: 1.05rem;
}

/* ─── Cards ────────────────────────────── */
.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  box-shadow: var(--card-shadow);
}

.card-grid {
  display: grid;
  gap: 20px;
  margin-top: 32px;
}

.three-up { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.guide-card {
  padding: 28px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.guide-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--card-glow);
}

.guide-card .card-icon {
  font-size: 2rem;
  margin-bottom: 12px;
}

.guide-card h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.guide-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.guide-card .card-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  color: var(--oracle-blue);
  font-weight: 600;
  font-size: 0.9rem;
}

/* ─── Chat Widget ──────────────────────── */
.chat-toggle {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 100;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--oracle-blue), var(--accent));
  color: #fff;
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 32px rgba(30, 167, 225, 0.3);
  border: none;
  cursor: pointer;
  transition: transform 0.2s ease;
}

.chat-toggle:hover { transform: scale(1.08); }

.chat-panel {
  position: fixed;
  bottom: 96px;
  right: 24px;
  z-index: 100;
  width: 380px;
  max-height: 520px;
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.4);
  display: none;
  flex-direction: column;
  overflow: hidden;
}

.chat-panel.is-open { display: flex; }

.chat-header {
  padding: 16px 20px;
  background: rgba(30, 167, 225, 0.08);
  border-bottom: 1px solid var(--border-soft);
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
}

.chat-header .oracle-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--profit);
  box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.16);
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
}

.chat-msg {
  max-width: 85%;
  padding: 10px 14px;
  border-radius: 14px;
  font-size: 0.92rem;
  line-height: 1.5;
}

.chat-msg.oracle {
  align-self: flex-start;
  background: rgba(30, 167, 225, 0.1);
  border: 1px solid rgba(30, 167, 225, 0.2);
  color: var(--text-primary);
}

.chat-msg.user {
  align-self: flex-end;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
}

.chat-input-bar {
  padding: 12px 16px;
  border-top: 1px solid var(--border-soft);
  display: flex;
  gap: 8px;
}

.chat-input {
  flex: 1;
  min-height: 40px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  font-size: 0.9rem;
  outline: none;
}

.chat-input:focus { border-color: var(--oracle-blue); }

.chat-send {
  min-width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--oracle-blue);
  color: #fff;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
}

/* ─── Search ───────────────────────────── */
.search-bar {
  max-width: 600px;
  margin: 32px auto 0;
  position: relative;
}

.search-input {
  width: 100%;
  min-height: 52px;
  padding: 0 20px 0 48px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border-soft);
  color: var(--text-primary);
  font-size: 1rem;
  outline: none;
  transition: border-color 0.2s ease;
}

.search-input:focus { border-color: var(--oracle-blue); }

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.1rem;
  pointer-events: none;
}

/* ─── Stats Bar ────────────────────────── */
.stats-bar {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 48px;
  padding: 24px 0;
  border-top: 1px solid rgba(160, 166, 173, 0.08);
  border-bottom: 1px solid rgba(160, 166, 173, 0.08);
}

.stat-item { text-align: center; }

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--oracle-blue);
}

.stat-label {
  margin-top: 4px;
  font-size: 0.82rem;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Footer ───────────────────────────── */
.site-footer {
  padding: 32px 0;
  border-top: 1px solid rgba(160, 166, 173, 0.08);
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.88rem;
}

.footer-links-row {
  display: flex;
  justify-content: center;
  gap: 24px;
  margin-top: 12px;
}

.footer-links-row a { color: var(--text-secondary); }
.footer-links-row a:hover { color: var(--text-primary); }

/* ─── Responsive ───────────────────────── */
@media (max-width: 900px) {
  .three-up { grid-template-columns: 1fr; }
  .two-up { grid-template-columns: 1fr; }
  .stats-bar { flex-direction: column; gap: 24px; }
  .chat-panel { width: calc(100% - 32px); right: 16px; }
  .site-nav { gap: 16px; }
}

@media (max-width: 600px) {
  .hero-section { padding: 56px 0 40px; }
  .section { padding: 48px 0; }
  .site-header { position: static; }
  .header-inner { flex-direction: column; padding: 14px 0; }
}

/* ===== Auth Gate Overlay ===== */
.auth-gate-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(14, 15, 19, 0.92);
  backdrop-filter: blur(8px);
}
.auth-gate-card {
  text-align: center;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-md);
  padding: 2.5rem 2rem;
  max-width: 400px;
  box-shadow: var(--card-glow);
}
.auth-gate-card h3 {
  color: var(--text-primary);
  font-size: 1.25rem;
  margin: 0 0 0.5rem;
}
.auth-gate-card p {
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin: 0 0 1.5rem;
  line-height: 1.5;
}
.auth-gate-btn {
  display: inline-block;
  background: var(--oracle-blue);
  color: #fff;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.875rem;
  transition: opacity 0.2s;
}
.auth-gate-btn:hover { opacity: 0.85; }

/* ===== Nav Auth Dropdown ===== */
.nav-auth-btn {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 0.375rem 0.75rem;
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  transition: color 0.2s, border-color 0.2s;
  white-space: nowrap;
}
.nav-auth-btn:hover {
  color: var(--oracle-blue);
  border-color: var(--oracle-blue);
}
.nav-auth-btn.logged-in {
  color: var(--oracle-blue);
  border-color: var(--border-strong);
}
.nav-auth-wrap {
  position: relative;
  display: inline-flex;
}
.nav-user-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-sm);
  padding: 1rem;
  min-width: 220px;
  box-shadow: var(--card-shadow);
  z-index: 9998;
}
.nav-user-menu.hidden { display: none; }
.nav-user-email {
  font-size: 0.8125rem;
  color: var(--text-primary);
  margin: 0 0 0.25rem;
  word-break: break-all;
}
.nav-sub-status {
  font-size: 0.75rem;
  margin: 0 0 0.75rem;
  color: var(--muted);
}
.nav-sub-status.status-active { color: var(--profit); }
.nav-sub-status.status-past_due { color: var(--loss); }
.nav-menu-links {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  margin-bottom: 0.75rem;
}
.nav-menu-btn {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-primary);
  text-decoration: none;
  padding: 0.5rem 0.625rem;
  border-radius: 6px;
  transition: background 0.15s, color 0.15s;
}
.nav-menu-btn:hover {
  background: rgba(30, 167, 225, 0.1);
  color: var(--oracle-blue);
}
.nav-menu-btn.hidden { display: none; }
.nav-logout-btn {
  display: block;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  text-decoration: none;
  padding-top: 0.5rem;
  border-top: 1px solid var(--border-soft);
}
.nav-logout-btn:hover { color: var(--loss); }

/* ===== Profile Page ===== */
.profile-field {
  margin-bottom: 24px;
}
.profile-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 8px;
}
.profile-field input[type="text"],
.profile-field input[type="email"] {
  width: 100%;
  padding: 12px 16px;
  background: var(--card-bg);
  border: 1px solid var(--border-soft);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 0.2s;
}
.profile-field input:focus {
  outline: none;
  border-color: var(--oracle-blue);
}
.profile-field input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.field-hint {
  display: block;
  margin-top: 6px;
  font-size: 0.78rem;
  color: var(--muted);
}
.profile-status-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
}
.profile-status-badge.status-active {
  background: rgba(76, 175, 80, 0.12);
  color: var(--profit);
}
.profile-status-badge.status-none,
.profile-status-badge.status-canceled {
  background: rgba(160, 166, 173, 0.1);
  color: var(--muted);
}
.profile-status-badge.status-past_due {
  background: rgba(229, 57, 53, 0.12);
  color: var(--loss);
}
.profile-save-btn {
  width: 100%;
  padding: 14px;
  background: var(--oracle-blue);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.2s;
}
.profile-save-btn:hover { opacity: 0.85; }
.profile-save-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.profile-feedback {
  padding: 12px 16px;
  border-radius: 8px;
  font-size: 0.88rem;
  margin-bottom: 20px;
}
.profile-feedback.success {
  background: rgba(76, 175, 80, 0.1);
  border: 1px solid rgba(76, 175, 80, 0.3);
  color: var(--profit);
}
.profile-feedback.error {
  background: rgba(229, 57, 53, 0.1);
  border: 1px solid rgba(229, 57, 53, 0.3);
  color: var(--loss);
}