/* ================================================================
   Solushun.ai — Main Stylesheet
   Design: Clean, international, minimal. Mobile-first.
   ================================================================ */

/* ── RESET & BASE ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', 'Noto Sans', system-ui, sans-serif;
  color: #1a1a2e;
  background: #f7f8fc;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── CSS VARIABLES ────────────────────────────────────────────── */
:root {
  --brand:      #4361ee;
  --brand-dark: #3451d1;
  --brand-light:#eef0fd;
  --accent:     #f72585;
  --success:    #06d6a0;
  --warning:    #ffd60a;
  --danger:     #ef233c;
  --text:       #1a1a2e;
  --text-muted: #6b7280;
  --text-light: #9ca3af;
  --border:     #e5e7eb;
  --bg:         #f7f8fc;
  --bg-white:   #ffffff;
  --bg-card:    #ffffff;
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.07);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.08);
  --shadow-lg:  0 12px 40px rgba(0,0,0,0.1);
  --radius-sm:  6px;
  --radius-md:  10px;
  --radius-lg:  16px;
  --radius-xl:  24px;
  --transition: 0.18s ease;
  --container:  1100px;
  --header-h:   62px;
}

/* ── TYPOGRAPHY ───────────────────────────────────────────────── */
h1, h2, h3, h4, h5 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
}
h1 { font-size: clamp(1.75rem, 4vw, 2.6rem); }
h2 { font-size: clamp(1.35rem, 3vw, 1.9rem); }
h3 { font-size: 1.2rem; }
h4 { font-size: 1rem; }
p  { color: var(--text-muted); }
a  { color: var(--brand); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--brand-dark); }
code, .mono { font-family: 'JetBrains Mono', 'Courier New', monospace; }
small { font-size: 0.8rem; }

/* ── LAYOUT ───────────────────────────────────────────────────── */
.container { max-width: var(--container); margin: 0 auto; padding: 0 1.25rem; }
.site-main { flex: 1; padding-top: var(--header-h); }
.page-section { padding: 3rem 0; }
.page-section-lg { padding: 5rem 0; }

/* ── ANNOUNCEMENT BAR ────────────────────────────────────────── */
.announcement-bar {
  background: var(--brand); color: #fff;
  padding: 0.5rem 1rem; text-align: center;
  display: flex; align-items: center; justify-content: center; gap: 1rem;
  font-size: 0.85rem; position: relative; z-index: 200;
}
.ann-close { background: none; border: none; color: #fff; cursor: pointer; font-size: 1.1rem; line-height: 1; opacity: 0.8; }
.ann-close:hover { opacity: 1; }

/* ── HEADER ───────────────────────────────────────────────────── */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  height: var(--header-h);
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  transition: box-shadow var(--transition);
}
.site-header.scrolled { box-shadow: var(--shadow-md); }
.header-inner {
  height: 100%; display: flex; align-items: center;
  justify-content: space-between; gap: 1rem;
}

/* Logo */
.logo { display: flex; align-items: center; gap: 0.5rem; text-decoration: none; }
.logo-mark {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 1rem; flex-shrink: 0;
  font-family: 'JetBrains Mono', monospace;
}
.logo-text { font-size: 1.1rem; font-weight: 700; color: var(--text); }
.logo-dot  { color: var(--brand); }
.logo-ai   { color: var(--brand); font-size: 0.8rem; vertical-align: super; }

/* Nav */
.main-nav { display: flex; align-items: center; gap: 0.25rem; }
.nav-link {
  padding: 0.4rem 0.85rem; border-radius: var(--radius-sm);
  font-size: 0.88rem; font-weight: 500; color: var(--text-muted);
  transition: all var(--transition); white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--brand); background: var(--brand-light); }
.nav-admin { color: var(--accent) !important; }
.nav-admin:hover { background: #fef0f5 !important; }

/* Header actions */
.header-actions { display: flex; align-items: center; gap: 0.6rem; }

.credit-badge {
  display: flex; align-items: center; gap: 0.4rem;
  background: var(--brand-light); color: var(--brand);
  padding: 0.35rem 0.8rem; border-radius: 100px;
  font-size: 0.8rem; font-weight: 600;
  text-decoration: none; transition: all var(--transition);
  border: 1px solid rgba(67,97,238,0.2);
}
.credit-badge:hover { background: var(--brand); color: #fff; }

/* User menu */
.user-menu-wrap { position: relative; }
.user-btn {
  display: flex; align-items: center; gap: 0.4rem;
  background: none; border: 1px solid var(--border);
  padding: 0.3rem 0.6rem 0.3rem 0.4rem;
  border-radius: 100px; cursor: pointer;
  font-size: 0.85rem; font-weight: 500; color: var(--text);
  transition: all var(--transition);
}
.user-btn:hover { border-color: var(--brand); color: var(--brand); }
.user-avatar {
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.78rem; font-weight: 700; flex-shrink: 0;
}
.user-dropdown {
  position: absolute; right: 0; top: calc(100% + 8px);
  background: var(--bg-white); border: 1px solid var(--border);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  min-width: 200px; overflow: hidden;
  opacity: 0; visibility: hidden; transform: translateY(-6px);
  transition: all 0.15s ease; z-index: 50;
}
.user-dropdown.open { opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-header { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); }
.dropdown-header strong { display: block; font-size: 0.9rem; color: var(--text); }
.dropdown-header span { font-size: 0.78rem; color: var(--text-muted); }
.dropdown-item {
  display: block; padding: 0.6rem 1rem;
  font-size: 0.875rem; color: var(--text);
  transition: background var(--transition);
}
.dropdown-item:hover { background: var(--bg); color: var(--brand); }
.dropdown-divider { border-top: 1px solid var(--border); margin: 0.25rem 0; }
.text-danger { color: var(--danger) !important; }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column;
  gap: 4px; background: none; border: none;
  cursor: pointer; padding: 6px; border-radius: var(--radius-sm);
}
.hamburger span { width: 20px; height: 2px; background: var(--text); display: block; transition: all 0.25s; }
.hamburger.open span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Mobile nav */
.mobile-nav {
  display: none; flex-direction: column;
  background: var(--bg-white); border-top: 1px solid var(--border);
  padding: 1rem; gap: 0.25rem;
  position: fixed; top: var(--header-h); left: 0; right: 0;
  box-shadow: var(--shadow-lg); z-index: 99;
  max-height: calc(100vh - var(--header-h));
  overflow-y: auto;
}
.mobile-nav.open { display: flex; }
.mobile-nav-link {
  display: block; padding: 0.75rem 1rem;
  color: var(--text); font-weight: 500; font-size: 0.95rem;
  border-radius: var(--radius-sm); transition: all var(--transition);
}
.mobile-nav-link:hover { background: var(--bg); color: var(--brand); }
.mobile-nav-user {
  display: flex; align-items: center; gap: 0.75rem;
  padding: 0.75rem 1rem; margin-bottom: 0.5rem;
  background: var(--bg); border-radius: var(--radius-sm);
}

/* ── FOOTER ───────────────────────────────────────────────────── */
.site-footer {
  background: var(--text);
  color: rgba(255,255,255,0.7);
  padding: 3rem 0 1.5rem;
  margin-top: auto;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 2.5rem;
  margin-bottom: 2.5rem;
}
.footer-brand .logo-text { color: #fff; }
.footer-brand .logo-mark { background: rgba(255,255,255,0.15); }
.footer-brand p { margin-top: 0.75rem; font-size: 0.85rem; line-height: 1.7; }
.footer-col h5 {
  color: #fff; font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.1em;
  margin-bottom: 1rem;
}
.footer-col a { display: block; color: rgba(255,255,255,0.6); font-size: 0.875rem; padding: 0.2rem 0; }
.footer-col a:hover { color: #fff; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.25rem;
  display: flex; justify-content: space-between;
  align-items: center; flex-wrap: wrap; gap: 0.5rem;
  font-size: 0.78rem;
}

/* ── FLASH MESSAGES ───────────────────────────────────────────── */
.flash-message {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.85rem 1.25rem; margin: 0; gap: 1rem;
  font-size: 0.875rem; font-weight: 500;
}
.flash-success { background: #d1fae5; color: #065f46; border-bottom: 1px solid #a7f3d0; }
.flash-error   { background: #fee2e2; color: #991b1b; border-bottom: 1px solid #fca5a5; }
.flash-info    { background: #dbeafe; color: #1e40af; border-bottom: 1px solid #bfdbfe; }
.flash-warning { background: #fef9c3; color: #854d0e; border-bottom: 1px solid #fde047; }
.flash-close   { background: none; border: none; cursor: pointer; font-size: 1.1rem; opacity: 0.7; }
.flash-close:hover { opacity: 1; }

/* ── BUTTONS ──────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 0.45rem; padding: 0.6rem 1.35rem;
  font-family: inherit; font-size: 0.9rem; font-weight: 600;
  border-radius: var(--radius-sm); cursor: pointer;
  border: 1.5px solid transparent; transition: all var(--transition);
  text-decoration: none; white-space: nowrap; line-height: 1;
}
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-primary  { background: var(--brand); color: #fff; border-color: var(--brand); }
.btn-primary:hover { background: var(--brand-dark); border-color: var(--brand-dark); color: #fff; }
.btn-secondary{ background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { border-color: var(--brand); color: var(--brand); }
.btn-ghost    { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand); }
.btn-danger   { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #c81e32; color: #fff; }
.btn-success  { background: var(--success); color: #fff; border-color: var(--success); }
.btn-sm  { padding: 0.4rem 0.9rem; font-size: 0.8rem; }
.btn-lg  { padding: 0.8rem 1.75rem; font-size: 1rem; }
.btn-full{ width: 100%; }
.btn-icon{ padding: 0.5rem; border-radius: var(--radius-sm); aspect-ratio: 1; }
.btn .spinner-sm { width: 14px; height: 14px; border: 2px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.6s linear infinite; display: none; }
.btn.loading .spinner-sm { display: block; }
.btn.loading .btn-label { opacity: 0.6; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── CARDS ────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 1.5rem;
  box-shadow: var(--shadow-sm);
}
.card-sm  { padding: 1rem; }
.card-lg  { padding: 2rem; }
.card-header { border-bottom: 1px solid var(--border); padding-bottom: 1rem; margin-bottom: 1rem; display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: 1rem; font-weight: 700; color: var(--text); }

/* ── FORMS ────────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.1rem; }
.form-label { display: block; font-size: 0.85rem; font-weight: 600; color: var(--text); margin-bottom: 0.4rem; }
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  display: block; width: 100%;
  padding: 0.65rem 0.9rem;
  font-family: inherit; font-size: 0.9rem; color: var(--text);
  background: var(--bg-white); border: 1.5px solid var(--border);
  border-radius: var(--radius-sm); transition: border-color var(--transition);
  outline: none; appearance: none;
}
.form-control:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(67,97,238,0.12); }
.form-control::placeholder { color: var(--text-light); }
.form-control[readonly] { background: var(--bg); cursor: not-allowed; }
.form-hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.3rem; }
.form-error { font-size: 0.78rem; color: var(--danger); margin-top: 0.3rem; }
textarea.form-control { resize: vertical; min-height: 100px; }
select.form-control { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2.5'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.75rem center; padding-right: 2rem; }
.form-row { display: grid; gap: 1rem; }
.form-row-2 { grid-template-columns: 1fr 1fr; }

/* ── BADGES ───────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem;
  padding: 0.2rem 0.6rem; border-radius: 100px;
  font-size: 0.72rem; font-weight: 600; white-space: nowrap;
}
.badge-primary { background: var(--brand-light); color: var(--brand); }
.badge-success { background: #d1fae5; color: #065f46; }
.badge-danger  { background: #fee2e2; color: #991b1b; }
.badge-warning { background: #fef9c3; color: #854d0e; }
.badge-muted   { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }
.badge-subject { background: #f0e6ff; color: #6d28d9; }

/* ── LANDING PAGE ─────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #f0f4ff 0%, #fafbff 60%, #f5f0ff 100%);
  padding: 5rem 0 4rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}
.hero-tag {
  display: inline-flex; align-items: center; gap: 0.5rem;
  background: var(--brand-light); color: var(--brand);
  padding: 0.3rem 1rem; border-radius: 100px;
  font-size: 0.78rem; font-weight: 600; margin-bottom: 1.5rem;
  border: 1px solid rgba(67,97,238,0.2);
}
.hero h1 { margin-bottom: 1rem; max-width: 720px; margin-inline: auto; }
.hero .hero-sub {
  font-size: 1.1rem; color: var(--text-muted);
  max-width: 560px; margin: 0 auto 2.5rem;
}
.hero-actions { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.hero-stats {
  display: flex; gap: 2.5rem; justify-content: center;
  margin-top: 3.5rem; flex-wrap: wrap;
}
.hero-stat-num { font-size: 1.6rem; font-weight: 800; color: var(--brand); display: block; }
.hero-stat-lbl { font-size: 0.8rem; color: var(--text-muted); }

.subjects-strip {
  background: var(--bg-white); border-bottom: 1px solid var(--border);
  padding: 1.2rem 0; overflow: hidden;
}
.subjects-inner {
  display: flex; gap: 0.75rem; flex-wrap: wrap;
  justify-content: center; padding: 0 1rem;
}
.subject-chip {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.35rem 0.85rem; border-radius: 100px;
  background: var(--bg); border: 1px solid var(--border);
  font-size: 0.8rem; font-weight: 500; color: var(--text-muted);
  transition: all var(--transition);
}
.subject-chip:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }

/* How it works */
.how-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; margin-top: 2.5rem; }
.how-card { text-align: center; padding: 2rem 1.5rem; }
.how-icon { width: 56px; height: 56px; border-radius: var(--radius-md); background: var(--brand-light); color: var(--brand); display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; font-size: 1.5rem; }
.how-card h3 { font-size: 1rem; margin-bottom: 0.4rem; }
.how-card p { font-size: 0.875rem; }
.how-step { display: inline-block; width: 24px; height: 24px; background: var(--brand); color: #fff; border-radius: 50%; font-size: 0.72rem; font-weight: 700; line-height: 24px; text-align: center; margin-bottom: 0.75rem; }

/* Pricing */
.pricing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; max-width: 760px; margin: 2.5rem auto 0; }
.price-card { border: 1.5px solid var(--border); border-radius: var(--radius-lg); padding: 2rem; position: relative; background: var(--bg-white); }
.price-card.featured { border-color: var(--brand); box-shadow: 0 0 0 4px rgba(67,97,238,0.07); }
.price-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--brand); color: #fff; padding: 0.2rem 1rem; border-radius: 100px; font-size: 0.72rem; font-weight: 700; }
.price-name { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 1rem; }
.price-amount { font-size: 2.5rem; font-weight: 800; color: var(--text); margin-bottom: 0.25rem; }
.price-amount small { font-size: 0.9rem; font-weight: 400; color: var(--text-muted); }
.price-desc { font-size: 0.85rem; margin-bottom: 1.5rem; }
.price-features { list-style: none; margin-bottom: 1.75rem; }
.price-features li { display: flex; align-items: flex-start; gap: 0.5rem; padding: 0.4rem 0; font-size: 0.875rem; border-bottom: 1px solid var(--border); color: var(--text-muted); }
.price-features li:last-child { border-bottom: none; }
.price-features .check { color: var(--success); font-size: 0.9rem; flex-shrink: 0; }
.price-features .x { color: var(--text-light); font-size: 0.9rem; flex-shrink: 0; }

/* ── ASK PAGE ─────────────────────────────────────────────────── */
.ask-layout { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
.ask-card { background: var(--bg-white); border: 1.5px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.ask-tabs { display: flex; border-bottom: 1px solid var(--border); background: var(--bg); }
.ask-tab {
  flex: 1; padding: 0.85rem 0.5rem;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 0.85rem; font-weight: 500;
  color: var(--text-muted); display: flex; align-items: center;
  justify-content: center; gap: 0.4rem; transition: all var(--transition);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.ask-tab.active { color: var(--brand); border-bottom-color: var(--brand); background: var(--bg-white); }
.ask-body { padding: 1.5rem; }
.ask-panel { display: none; }
.ask-panel.active { display: block; }

/* Image upload */
.img-drop {
  border: 2px dashed var(--border); border-radius: var(--radius-md);
  padding: 2.5rem 1rem; text-align: center; cursor: pointer;
  transition: all var(--transition); position: relative;
}
.img-drop:hover, .img-drop.dragover { border-color: var(--brand); background: var(--brand-light); }
.img-drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.img-drop-icon { font-size: 2rem; margin-bottom: 0.5rem; display: block; }
.img-drop p { font-size: 0.85rem; color: var(--text-muted); }
.img-preview { margin-top: 1rem; position: relative; display: none; }
.img-preview img { max-width: 100%; max-height: 260px; border-radius: var(--radius-sm); border: 1px solid var(--border); object-fit: contain; }
.img-preview .remove-img { position: absolute; top: -8px; right: -8px; background: var(--danger); color: #fff; border: none; border-radius: 50%; width: 22px; height: 22px; font-size: 0.8rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }

/* Credit meter */
.credit-meter { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; }
.credit-meter-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.5rem; font-size: 0.82rem; }
.credit-bar { height: 6px; background: var(--border); border-radius: 100px; overflow: hidden; }
.credit-bar-fill { height: 100%; background: var(--brand); border-radius: 100px; transition: width 0.4s ease; }
.credit-bar-fill.low { background: var(--danger); }

/* Subject selector */
.subject-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.5rem; }
.subject-btn {
  padding: 0.55rem 0.4rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--bg);
  cursor: pointer; text-align: center; font-size: 0.75rem;
  font-weight: 500; color: var(--text-muted);
  transition: all var(--transition); font-family: inherit;
}
.subject-btn:hover { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.subject-btn.selected { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.subject-btn .subj-icon { display: block; font-size: 1.1rem; margin-bottom: 0.2rem; }

/* ── RESULT CARD ──────────────────────────────────────────────── */
.result-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-top: 1.5rem; }
.result-header { padding: 1rem 1.25rem; background: var(--bg); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.5rem; }
.professor-badge { display: flex; align-items: center; gap: 0.6rem; }
.prof-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--brand), #7c3aed); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.prof-name { font-size: 0.88rem; font-weight: 700; color: var(--text); }
.prof-subject { font-size: 0.75rem; color: var(--text-muted); }
.result-body { padding: 1.5rem; }
.result-section { margin-bottom: 1.5rem; }
.result-section:last-child { margin-bottom: 0; }
.result-section-title { font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); margin-bottom: 0.75rem; display: flex; align-items: center; gap: 0.4rem; }
.result-section-title::before { content: ''; width: 3px; height: 12px; background: var(--brand); border-radius: 2px; }
.solution-content { font-size: 0.95rem; line-height: 1.8; color: var(--text); white-space: pre-wrap;}
.solution-content p { margin-bottom: 0.75rem; color: var(--text); }
.solution-content .step { display: flex; gap: 0.75rem; margin-bottom: 0.75rem; padding: 0.75rem; background: var(--bg); border-radius: var(--radius-sm); border-left: 3px solid var(--brand); }
.shortcut-box { background: linear-gradient(135deg, #fff9e6, #fffbf0); border: 1px solid #fde68a; border-radius: var(--radius-md); padding: 1rem 1.25rem; }
.shortcut-box .shortcut-label { font-size: 0.75rem; font-weight: 700; color: #92400e; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.4rem; }
.similar-grid { display: grid; gap: 0.75rem; }
.similar-item { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem; font-size: 0.88rem; cursor: pointer; transition: all var(--transition); }
.similar-item:hover { border-color: var(--brand); background: var(--brand-light); }
.similar-item-q { font-weight: 600; color: var(--text); margin-bottom: 0.3rem; }
.similar-item-a { color: var(--text-muted); font-size: 0.82rem; }
.locked-overlay { background: var(--bg); border: 1.5px dashed var(--border); border-radius: var(--radius-md); padding: 2rem; text-align: center; }
.locked-overlay .lock-icon { font-size: 1.75rem; margin-bottom: 0.5rem; }

/* Loading skeleton */
.skeleton { background: linear-gradient(90deg, var(--border) 25%, #f0f0f0 50%, var(--border) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: var(--radius-sm); }
.skel-line  { height: 14px; margin-bottom: 0.6rem; }
.skel-line.w75 { width: 75%; }
.skel-line.w50 { width: 50%; }
@keyframes shimmer { to { background-position: -200% 0; } }

/* ── DASHBOARD ────────────────────────────────────────────────── */
.dashboard-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1.25rem; display: flex; flex-direction: column; gap: 0.25rem; }
.stat-card-num { font-size: 1.9rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-card-lbl { font-size: 0.8rem; color: var(--text-muted); }
.stat-card-sub { font-size: 0.75rem; color: var(--text-light); }
.stat-card.highlight .stat-card-num { color: var(--brand); }

/* ── TABLE ────────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.data-table { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
.data-table th { background: var(--bg); font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--text-muted); padding: 0.7rem 1rem; text-align: left; border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--bg); }
.data-table .td-actions { display: flex; gap: 0.4rem; }

/* ── PAGINATION ───────────────────────────────────────────────── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 0.3rem; padding: 1.25rem 0; flex-wrap: wrap; }
.page-link { display: flex; align-items: center; justify-content: center; min-width: 34px; height: 34px; padding: 0 0.5rem; border-radius: var(--radius-sm); font-size: 0.85rem; border: 1px solid var(--border); color: var(--text-muted); transition: all var(--transition); }
.page-link:hover { border-color: var(--brand); color: var(--brand); }
.page-link.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.page-link.disabled { opacity: 0.4; pointer-events: none; }

/* ── AUTH PAGES ───────────────────────────────────────────────── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem 1rem; background: linear-gradient(135deg, #f0f4ff 0%, #fafbff 100%); }
.auth-card { width: 100%; max-width: 420px; background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-xl); padding: 2.5rem; box-shadow: var(--shadow-lg); }
.auth-logo { text-align: center; margin-bottom: 2rem; }
.auth-title { font-size: 1.35rem; font-weight: 800; text-align: center; margin-bottom: 0.25rem; }
.auth-sub { text-align: center; font-size: 0.875rem; margin-bottom: 1.75rem; }
.auth-divider { display: flex; align-items: center; gap: 0.75rem; margin: 1.25rem 0; }
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
.auth-divider span { font-size: 0.78rem; color: var(--text-light); }
.auth-switch { text-align: center; margin-top: 1.5rem; font-size: 0.875rem; }
/* Honeypot */
.hp-field { position: absolute; left: -9999px; top: -9999px; opacity: 0; }

/* ── RECHARGE PAGE ────────────────────────────────────────────── */
.recharge-layout { display: grid; grid-template-columns: 1fr 340px; gap: 1.5rem; align-items: start; }
.amount-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0.6rem; margin-bottom: 1rem; }
.preset-btn {
  padding: 0.65rem 0.5rem; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border); background: var(--bg);
  cursor: pointer; text-align: center; font-family: inherit;
  font-size: 0.85rem; font-weight: 600; color: var(--text);
  transition: all var(--transition);
}
.preset-btn:hover, .preset-btn.selected { border-color: var(--brand); color: var(--brand); background: var(--brand-light); }
.preset-btn small { display: block; font-size: 0.72rem; font-weight: 400; color: var(--text-muted); }
.preset-btn.selected small { color: var(--brand); }

/* ── HISTORY PAGE ─────────────────────────────────────────────── */
.history-filters { display: flex; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.history-item { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 1rem 1.25rem; margin-bottom: 0.75rem; cursor: pointer; transition: all var(--transition); }
.history-item:hover { border-color: var(--brand); box-shadow: var(--shadow-sm); }
.history-item-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 0.4rem; }
.history-item-q { font-size: 0.9rem; font-weight: 600; color: var(--text); flex: 1; }
.history-item-meta { display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap; }

/* ── PROFILE PAGE ─────────────────────────────────────────────── */
.profile-layout { display: grid; grid-template-columns: 240px 1fr; gap: 1.5rem; align-items: start; }
.profile-nav { background: var(--bg-white); border: 1px solid var(--border); border-radius: var(--radius-md); overflow: hidden; }
.profile-nav-item { display: block; padding: 0.75rem 1rem; font-size: 0.875rem; font-weight: 500; color: var(--text-muted); border-bottom: 1px solid var(--border); transition: all var(--transition); }
.profile-nav-item:last-child { border-bottom: none; }
.profile-nav-item.active, .profile-nav-item:hover { color: var(--brand); background: var(--brand-light); }

/* ── UTILITIES ────────────────────────────────────────────────── */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted) !important; }
.text-brand  { color: var(--brand) !important; }
.text-success{ color: var(--success) !important; }
.text-danger { color: var(--danger) !important; }
.text-warning{ color: #d97706 !important; }
.mt-0{margin-top:0}.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}.mt-4{margin-top:2rem}
.mb-0{margin-bottom:0}.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}
.gap-1{gap:.5rem}.gap-2{gap:1rem}.gap-3{gap:1.5rem}
.flex{display:flex}.flex-col{flex-direction:column}.items-center{align-items:center}.justify-between{justify-content:space-between}.flex-wrap{flex-wrap:wrap}.flex-1{flex:1}
.d-none{display:none!important}.d-none-sm{display:none}
.divider{border:none;border-top:1px solid var(--border);margin:1.25rem 0}
.empty-state{text-align:center;padding:3rem 1rem}
.empty-state-icon{font-size:2.5rem;margin-bottom:0.75rem;display:block}
.empty-state h3{font-size:1rem;margin-bottom:.4rem}
.empty-state p{font-size:.875rem;max-width:280px;margin:0 auto .25rem}

/* ── ADS ──────────────────────────────────────────────────────── */
.ad-slot { text-align: center; padding: 0.5rem; }
.ad-label { font-size: 0.65rem; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.1em; display: block; margin-bottom: 0.25rem; }

/* ── MATH RENDERING ───────────────────────────────────────────── */
.katex-display { overflow-x: auto; padding: 0.5rem 0; }
.math-inline .katex { font-size: 1em; }

/* ================================================================
   RESPONSIVE
   ================================================================ */
@media (max-width: 1024px) {
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .dashboard-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  :root { --header-h: 58px; }
  .main-nav { display: none; }
  .hamburger { display: flex; }
  .d-none-sm { display: none !important; }
  .ask-layout { grid-template-columns: 1fr; }
  .recharge-layout { grid-template-columns: 1fr; }
  .profile-layout { grid-template-columns: 1fr; }
  .profile-nav { display: flex; overflow-x: auto; border-radius: var(--radius-sm); }
  .profile-nav-item { border-bottom: none; border-right: 1px solid var(--border); white-space: nowrap; }
  .how-grid { grid-template-columns: 1fr; }
  .pricing-grid { grid-template-columns: 1fr; }
  .form-row-2 { grid-template-columns: 1fr; }
  .subject-grid { grid-template-columns: repeat(3, 1fr); }
  .amount-presets { grid-template-columns: repeat(2, 1fr); }
  .hero { padding: 3rem 0 2.5rem; }
  .hero-stats { gap: 1.5rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 1.5rem; }
  .footer-col:first-child { grid-column: 1 / -1; }
}

@media (max-width: 480px) {
  .dashboard-grid { grid-template-columns: 1fr 1fr; }
  .subject-grid { grid-template-columns: repeat(2, 1fr); }
  .auth-card { padding: 1.75rem 1.25rem; border-radius: var(--radius-lg); }
  .footer-grid { grid-template-columns: 1fr; }
  .header-actions .btn-ghost { display: none; }
  .amount-presets { grid-template-columns: repeat(2, 1fr); }
}
