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

:root {
  --bg:         #0d0f1a;
  --card-bg:    rgba(23, 27, 44, 0.65);
  --card-border:rgba(255, 255, 255, 0.08);
  --primary:    #3b82f6;
  --primary-h:  #2563eb;
  --accent:     #8b5cf6;
  --success:    #10b981;
  --danger:     #ef4444;
  --text:       #f8fafc;
  --muted:      #94a3b8;
}

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

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  background-image:
    radial-gradient(circle at 15% 40%, rgba(59,130,246,.12) 0%, transparent 55%),
    radial-gradient(circle at 85% 20%, rgba(139,92,246,.12) 0%, transparent 55%);
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.55;
  font-size: 15px;
}

/* ── Layout ─────────────────────────────────────── */
.container {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 18px 48px;
}

/* ── Typography ──────────────────────────────────── */
h1 {
  font-size: 1.8rem;
  font-weight: 700;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, #fff 0%, #94a3b8 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

h2 {
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: -.02em;
  color: var(--text);
  margin-bottom: 12px;
}

h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.subtitle {
  color: var(--muted);
  font-size: .92rem;
  text-align: center;
}

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

/* ── Card ────────────────────────────────────────── */
.card {
  background: var(--card-bg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--card-border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 6px 24px rgba(0,0,0,.25);
}

/* ── Divider ─────────────────────────────────────── */
.divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--card-border), transparent);
  margin: 20px 0;
}

/* ── Buttons ─────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 10px;
  border: none;
  font-size: .88rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .15s, box-shadow .15s, background .15s;
  background: linear-gradient(135deg, var(--primary), #60a5fa);
  color: #fff;
  box-shadow: 0 3px 10px rgba(59,130,246,.35);
}
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(59,130,246,.5);
}

.btn.secondary {
  background: rgba(255,255,255,.06);
  border: 1px solid var(--card-border);
  box-shadow: none;
  color: var(--text);
}
.btn.secondary:hover {
  background: rgba(255,255,255,.12);
  box-shadow: none;
}

.btn.success {
  background: linear-gradient(135deg, var(--success), #34d399);
  box-shadow: 0 3px 10px rgba(16,185,129,.35);
}
.btn.success:hover {
  box-shadow: 0 5px 16px rgba(16,185,129,.5);
}

.btn.danger {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.3);
  color: #fca5a5;
  box-shadow: none;
}
.btn.danger:hover { background: rgba(239,68,68,.2); }

.btn-full { width: 100%; }

/* ── Form fields ─────────────────────────────────── */
.field { margin: 12px 0; }

label {
  display: block;
  margin-bottom: 6px;
  font-size: .82rem;
  font-weight: 500;
  color: var(--muted);
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="numeric"],
#captcha_answer {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-size: .95rem;
  font-family: inherit;
  transition: border-color .2s, background .2s;
}

/* Catch inputmode="numeric" inputs */
input[inputmode="numeric"] {
  width: 100%;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,.04);
  color: var(--text);
  font-size: .95rem;
  font-family: inherit;
  transition: border-color .2s, background .2s;
}

input:focus {
  outline: none;
  border-color: var(--primary);
  background: rgba(255,255,255,.08);
  box-shadow: 0 0 0 3px rgba(59,130,246,.18);
}

/* ── Code block ──────────────────────────────────── */
code {
  display: block;
  padding: 10px 12px;
  background: rgba(0,0,0,.35);
  border: 1px solid var(--card-border);
  border-radius: 10px;
  overflow-wrap: anywhere;
  font-family: monospace;
  font-size: .82rem;
  color: #a78bfa;
  line-height: 1.5;
}

/* ── Captcha ─────────────────────────────────────── */
.captcha {
  overflow: hidden;
  display: flex;
  justify-content: center;
  background: rgba(0,0,0,.4);
  border-radius: 10px;
  margin-bottom: 10px;
}
.captcha img { max-width: 100%; height: auto; display: block; }

/* ── Notice banners ──────────────────────────────── */
.notice {
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid rgba(59,130,246,.4);
  background: rgba(59,130,246,.08);
  display: flex;
  align-items: center;
  gap: 10px;
}
.notice.success {
  border-color: rgba(16,185,129,.4);
  background: rgba(16,185,129,.08);
}
.notice.error {
  border-color: rgba(239,68,68,.4);
  background: rgba(239,68,68,.08);
}

/* ── Subscription card internals ────────────────── */
.sub-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  flex-wrap: wrap;
}

.period-tabs {
  display: inline-flex;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--card-border);
}
.period-tab {
  padding: 5px 12px;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  border: none;
  font-family: inherit;
  transition: background .15s, color .15s;
  border-left: 1px solid var(--card-border);
}
.period-tab:first-child { border-left: none; }
.period-tab.active {
  background: var(--accent);
  color: #fff;
}

/* ── Inline pricing rows ─────────────────────────── */
.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 16px;
  border-radius: 12px;
  border: 1px solid var(--card-border);
  background: rgba(255,255,255,.03);
  gap: 12px;
}
.price-row.popular {
  border-color: rgba(59,130,246,.4);
  background: rgba(59,130,246,.06);
}
.price-row + .price-row { margin-top: 8px; }

.price-row-label { font-weight: 600; font-size: .92rem; }
.price-row-right { display: flex; align-items: center; gap: 14px; }
.price-row-amount { font-weight: 700; font-size: 1rem; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  background: var(--primary);
  color: #fff;
  margin-left: 8px;
}

/* ── Tables (admin) ──────────────────────────────── */
table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--card-border);
  font-size: .85rem;
}

/* ── Misc ────────────────────────────────────────── */
.row { display: flex; gap: 12px; align-items: center; }
.row > * { flex: 1; }
.link-box { margin-top: 6px; }

/* ── Responsive ──────────────────────────────────── */
@media (max-width: 600px) {
  h1 { font-size: 1.4rem; }
  .container { padding: 18px 14px 40px; }
  .sub-header { flex-direction: column; }
  .price-row { flex-wrap: wrap; }
}
