/* Standardized to production level */
/* Purpose: Modern dark-slate stylesheet for QuickStudy AI Vietnam SaaS pricing and checkout web portal */

:root {
  --bg: #0b1120;
  --surface: #111c33;
  --card: #172441;
  --border: #263659;
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --indigo: #6366f1;
  --emerald: #34d399;
  --rose: #fb7185;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

[hidden] {
  display: none !important;
}

body {
  background: radial-gradient(circle at top, #172554 0%, var(--bg) 52%);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  max-width: 1060px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Header */
.topbar {
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(11, 17, 32, 0.85);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.topbar-inner {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-badge {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
  background: linear-gradient(135deg, var(--indigo), var(--accent));
}

.brand-tag {
  display: block;
  font-size: 11px;
  color: var(--accent);
  font-weight: 600;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.lang-select {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
}

.lang-select:focus {
  border-color: var(--accent);
}

.account-bar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.account-pill {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
}

.divider {
  color: var(--muted);
}

.btn-primary-sm,
.btn-secondary-sm,
.btn-ghost-sm {
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-primary-sm {
  background: linear-gradient(135deg, var(--indigo), #0ea5e9);
  color: #ffffff;
  padding: 8px 14px;
  font-size: 13px;
}

.btn-secondary-sm {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  padding: 8px 14px;
  font-size: 13px;
}

.btn-ghost-sm {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 4px 9px;
  font-size: 12px;
}

/* Banners */
.banner {
  margin-top: 20px;
  padding: 12px 16px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
}

.banner.success {
  background: rgba(16, 185, 129, 0.16);
  color: var(--emerald);
  border: 1px solid rgba(52, 211, 153, 0.4);
}

.banner.error {
  background: rgba(244, 63, 94, 0.16);
  color: var(--rose);
  border: 1px solid rgba(251, 113, 133, 0.4);
}

/* Hero */
.hero {
  text-align: center;
  padding: 46px 0 28px;
}

.eyebrow {
  display: inline-block;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.14);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
  margin-bottom: 12px;
}

h1 {
  font-size: clamp(26px, 4vw, 38px);
  font-weight: 800;
  margin-bottom: 12px;
}

.hero-sub {
  max-width: 640px;
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: 15px;
}

.controls-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.cycle-switch {
  display: inline-flex;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 4px;
}

.cycle-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  padding: 8px 14px;
  border-radius: 7px;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.cycle-btn.active {
  background: var(--indigo);
  color: #ffffff;
}

.save-badge {
  background: rgba(52, 211, 153, 0.2);
  color: var(--emerald);
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 999px;
  margin-left: 4px;
}

.coupon-box {
  display: flex;
  gap: 6px;
}

.coupon-box input {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 11px;
  font-size: 13px;
  width: 195px;
  text-transform: uppercase;
}

.coupon-hint {
  margin-top: 10px;
  font-size: 13px;
  font-weight: 600;
  color: var(--emerald);
}

/* Pricing Grid */
.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr));
  gap: 18px;
  padding: 16px 0 48px;
}

.plan-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.plan-popular {
  border-color: var(--accent);
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.1) 0%, var(--surface) 45%);
}

.popular-tag {
  position: absolute;
  top: -11px;
  right: 18px;
  background: linear-gradient(135deg, var(--indigo), var(--accent));
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
}

.plan-head h2 {
  font-size: 20px;
  margin-bottom: 4px;
}

.plan-desc {
  color: var(--muted);
  font-size: 13px;
}

.plan-price {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.price-val {
  font-size: 30px;
  font-weight: 800;
  color: #ffffff;
}

.price-unit {
  color: var(--muted);
  font-size: 13.5px;
}

.plan-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13.5px;
  color: #cbd5e1;
  flex: 1;
}

.btn-plan {
  width: 100%;
  padding: 11px 14px;
  border-radius: 9px;
  border: 1px solid var(--border);
  background: var(--card);
  color: #ffffff;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
}

.btn-plan:hover {
  border-color: var(--accent);
}

.btn-plan-pro {
  border: none;
  background: linear-gradient(135deg, var(--indigo), #0ea5e9);
}

.qr-card {
  background: var(--card);
  border: 1px solid var(--accent);
  border-radius: 12px;
  padding: 18px;
  margin-bottom: 40px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

/* Referral Card */
.ref-card {
  background: linear-gradient(180deg, rgba(52, 211, 153, 0.08) 0%, var(--surface) 100%);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ref-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.ref-head h3 {
  font-size: 16.5px;
  margin-bottom: 4px;
}

.ref-sub {
  font-size: 13px;
  color: var(--muted);
}

.ref-badge {
  background: rgba(52, 211, 153, 0.16);
  color: var(--emerald);
  border: 1px solid rgba(52, 211, 153, 0.35);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12.5px;
  font-weight: 700;
  white-space: nowrap;
}

.ref-link-row,
.ref-claim-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.ref-link-row input,
.ref-claim-row input {
  flex: 1;
  min-width: 210px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 13px;
}

.ref-locked {
  font-size: 12.5px;
  color: var(--muted);
  font-weight: 600;
}

.ref-status {
  font-size: 13px;
  font-weight: 600;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  padding: 16px;
}

.modal-backdrop[hidden] {
  display: none;
}

.modal {
  width: 100%;
  max-width: 390px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 22px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.btn-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 16px;
  cursor: pointer;
}

.btn-google {
  width: 100%;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #ffffff;
  color: #0f172a;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.btn-google:hover {
  background: #f1f5f9;
}

.auth-note {
  text-align: center;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.45;
}
