/* ═══════════════════════════════════════════════════════
   SpaceShop — Dark Theme
   Zero external font dependencies, fast by design
   ═══════════════════════════════════════════════════════ */

:root {
  --bg:        #09090b;
  --surface:   #111113;
  --surface2:  #1c1c1f;
  --border:    #27272a;
  --border2:   #3f3f46;
  --text:      #fafafa;
  --muted:     #71717a;
  --muted2:    #a1a1aa;
  --primary:   #8b5cf6;
  --primary-d: #7c3aed;
  --primary-l: #a78bfa;
  --accent:    #06b6d4;
  --success:   #22c55e;
  --warning:   #f59e0b;
  --danger:    #ef4444;
  --radius:    12px;
  --radius-sm: 8px;
  --shadow:    0 1px 3px rgba(0,0,0,.5), 0 8px 24px rgba(0,0,0,.3);
  --font: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, 'Helvetica Neue', sans-serif;
  --mono: ui-monospace, 'SF Mono', 'Cascadia Code', 'Fira Code', monospace;
}

/* RTL font override */
body.rtl { --font: 'Tahoma', 'Arial', system-ui, sans-serif; }

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* ── Scrollbar ── */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 99px; }

/* ══════════════════════════════════════════════
   Layout
   ══════════════════════════════════════════════ */
.container {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.page {
  padding: 48px 0 80px;
  flex: 1;
}

.narrow {
  width: min(700px, 100%);
  margin: 0 auto;
}

.wide-form {
  width: min(960px, 100%);
  margin: 0 auto;
}

/* ══════════════════════════════════════════════
   Topbar
   ══════════════════════════════════════════════ */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(9, 9, 11, 0.85);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.nav {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}
.brand span { color: var(--primary-l); }

.nav nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
}

.nav nav a {
  color: var(--muted2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}
.nav nav a:hover { color: var(--text); background: var(--surface2); }

.lang-btn {
  background: rgba(139,92,246,.12) !important;
  border: 1px solid rgba(139,92,246,.3) !important;
  color: var(--primary-l) !important;
  border-radius: var(--radius-sm) !important;
  font-weight: 600 !important;
}
.lang-btn:hover {
  background: rgba(139,92,246,.2) !important;
  color: var(--text) !important;
}

.link-button {
  border: none;
  background: none;
  cursor: pointer;
  color: var(--muted2);
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  transition: color .15s, background .15s;
}
.link-button:hover { color: var(--text); background: var(--surface2); }

.inline { display: inline; }

/* ══════════════════════════════════════════════
   Flash messages
   ══════════════════════════════════════════════ */
.flash {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid;
}
.flash.success { background: rgba(34,197,94,.1); color: #86efac; border-color: rgba(34,197,94,.25); }
.flash.error   { background: rgba(239,68,68,.1);  color: #fca5a5; border-color: rgba(239,68,68,.25); }
.flash.warning { background: rgba(245,158,11,.1); color: #fcd34d; border-color: rgba(245,158,11,.25); }

/* ══════════════════════════════════════════════
   Typography
   ══════════════════════════════════════════════ */
.eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--primary-l);
  display: inline-block;
}

.hero { margin-bottom: 28px; }

.hero h1, .page-heading h1 {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: -.025em;
  line-height: 1.15;
  margin: 6px 0 10px;
  color: var(--text);
}

.gradient-title {
  background: linear-gradient(135deg, #fff 30%, var(--primary-l) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero p {
  color: var(--muted2);
  font-size: 15px;
  line-height: 1.65;
}

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

/* ══════════════════════════════════════════════
   Cards
   ══════════════════════════════════════════════ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
}

.glassy {
  background: rgba(17,17,19,.8);
  backdrop-filter: blur(12px);
  border-color: var(--border2);
}

/* ══════════════════════════════════════════════
   Forms
   ══════════════════════════════════════════════ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted2);
}

.full { grid-column: 1 / -1; }

.input {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.input::placeholder { color: var(--muted); }
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(139,92,246,.15);
}
select.input { cursor: pointer; }
textarea.input { resize: vertical; }

.field-error {
  font-size: 12px;
  font-weight: 600;
  color: #fca5a5;
  margin-top: 2px;
}

.actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

/* ── Password reveal ── */
.input-wrap { position: relative; display: flex; }
.input-wrap .input { padding-right: 42px; }
.reveal-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  color: var(--muted);
  padding: 4px;
  line-height: 1;
}
.reveal-btn:hover { color: var(--primary-l); }

body.rtl .input-wrap .input { padding-right: 14px; padding-left: 42px; }
body.rtl .reveal-btn { right: auto; left: 10px; }

/* ── Mono input ── */
.mono-input { font-family: var(--mono); letter-spacing: .05em; }

/* ══════════════════════════════════════════════
   Buttons
   ══════════════════════════════════════════════ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--border2);
  background: var(--surface2);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, border-color .15s, transform .1s;
  white-space: nowrap;
}
.button:hover { background: var(--border); border-color: var(--border2); }
.button:active { transform: scale(.98); }

.button.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.button.primary:hover { background: var(--primary-d); border-color: var(--primary-d); }

.wide { width: 100%; }

.danger-btn {
  border-color: rgba(239,68,68,.4);
  color: #fca5a5;
}
.danger-btn:hover {
  background: rgba(239,68,68,.12);
  border-color: var(--danger);
  color: #f87171;
}

.submit-btn { padding: 11px 28px; font-size: 15px; }

/* ══════════════════════════════════════════════
   Badges
   ══════════════════════════════════════════════ */
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 99px;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  white-space: nowrap;
  border: 1px solid transparent;
  background: var(--surface2);
  color: var(--muted2);
}
.badge.active { background: rgba(34,197,94,.12); color: #86efac; border-color: rgba(34,197,94,.3); }
.badge.pending, .badge.processing, .badge.customer_action_required {
  background: rgba(245,158,11,.12); color: #fcd34d; border-color: rgba(245,158,11,.3);
}
.badge.expired, .badge.failed, .badge.cancelled {
  background: rgba(239,68,68,.12); color: #fca5a5; border-color: rgba(239,68,68,.3);
}

/* ══════════════════════════════════════════════
   Summary DL
   ══════════════════════════════════════════════ */
.summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border-top: 1px solid var(--border);
  margin: 20px 0 0;
}
.summary div {
  padding: 14px 0;
  border-bottom: 1px solid var(--border);
}
.summary div:nth-child(odd) { padding-right: 20px; }
.summary .full-row { grid-column: 1 / -1; }
.summary dt {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  margin-bottom: 4px;
}
.summary dd {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  overflow-wrap: anywhere;
}
.mono-text { font-family: var(--mono); font-size: 13px; letter-spacing: .04em; }

/* ══════════════════════════════════════════════
   Status indicator
   ══════════════════════════════════════════════ */
.status-visual {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 4px;
}
.status-indicator {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 20px;
  font-weight: 700;
  flex-shrink: 0;
}
.status-indicator.active { background: rgba(34,197,94,.15); color: #86efac; }
.status-indicator.pending,
.status-indicator.processing,
.status-indicator.customer_action_required { background: rgba(245,158,11,.15); color: #fcd34d; }
.status-indicator.expired,
.status-indicator.failed,
.status-indicator.cancelled { background: rgba(239,68,68,.15); color: #fca5a5; }
.status-big-label { font-size: 18px; font-weight: 700; color: var(--text); }
.status-result-card { margin-top: 20px; }

/* ══════════════════════════════════════════════
   Success page
   ══════════════════════════════════════════════ */
.success-card { text-align: center; padding: 48px 32px; }

.success-burst {
  position: relative;
  width: 72px;
  height: 72px;
  margin: 0 auto 24px;
}
.success-icon-ring {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(34,197,94,.15);
  border: 2px solid rgba(34,197,94,.4);
  display: grid;
  place-items: center;
}
.success-icon { font-size: 28px; color: var(--success); }
.success-subtitle { color: var(--muted2); font-size: 14px; line-height: 1.65; margin: 6px 0 20px; }

.tracking-code-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.tracking-code {
  display: inline-block;
  padding: 10px 20px;
  border: 1px solid var(--border2);
  border-radius: var(--radius-sm);
  background: var(--surface2);
  font-family: var(--mono);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: .06em;
  color: var(--primary-l);
}
.copy-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--muted2);
  border-radius: var(--radius-sm);
  padding: 9px 16px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.copy-btn:hover { border-color: var(--primary); color: var(--primary-l); }
.copy-btn.copied { border-color: var(--success); color: var(--success); }

/* ══════════════════════════════════════════════
   Admin — Page headings
   ══════════════════════════════════════════════ */
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}
.page-heading h1 { margin-bottom: 0; }

/* ══════════════════════════════════════════════
   Admin — Metrics
   ══════════════════════════════════════════════ */
.metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 28px;
}
.metric {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 24px;
  transition: border-color .15s;
}
.metric:hover { border-color: var(--border2); }
.metric span {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
}
.metric strong {
  display: block;
  margin-top: 8px;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -.02em;
  color: var(--text);
}

/* ══════════════════════════════════════════════
   Admin — Tables
   ══════════════════════════════════════════════ */
.two-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.detail-layout { grid-template-columns: 1.4fr .6fr; align-items: start; }
.detail-layout > div { display: grid; gap: 20px; }

.card h2 {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
}

.status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.status-row h2 { font-size: 16px; font-weight: 700; }

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}
table { width: 100%; border-collapse: collapse; min-width: 860px; }
th, td { padding: 14px 20px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); background: var(--surface2); }
tbody tr { transition: background .1s; }
tbody tr:hover { background: var(--surface2); }
tbody tr:last-child td { border-bottom: none; }
td a { color: var(--primary-l); font-weight: 600; }
td a:hover { color: var(--text); }
td strong { font-weight: 600; color: var(--text); }
td small { font-family: var(--mono); font-size: 12px; color: var(--muted2); }

.empty { text-align: center; padding: 48px; color: var(--muted); font-size: 14px; }

/* ══════════════════════════════════════════════
   Admin — Filters, Pagination
   ══════════════════════════════════════════════ */
.filters {
  display: grid;
  grid-template-columns: minmax(220px, 2fr) 1fr 1fr auto;
  gap: 12px;
  margin-bottom: 20px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 28px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.pagination a {
  color: var(--primary-l);
  font-weight: 600;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}
.pagination a:hover { border-color: var(--border2); background: var(--surface2); }

/* ══════════════════════════════════════════════
   Admin — List rows
   ══════════════════════════════════════════════ */
.list { display: flex; flex-direction: column; gap: 2px; margin: 0 -8px; }
.list-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 8px;
  border-radius: var(--radius-sm);
  transition: background .1s;
}
.list-row:hover { background: var(--surface2); }
.list-row strong { display: block; font-weight: 600; font-size: 14px; color: var(--text); }
.list-row small { color: var(--muted2); font-size: 12px; margin-top: 2px; display: block; }

/* ══════════════════════════════════════════════
   Admin — Stack forms, HR, Notes
   ══════════════════════════════════════════════ */
.stack-form { display: grid; gap: 10px; }
.stack-form label { font-size: 13px; font-weight: 600; color: var(--muted2); }
hr { border: none; border-top: 1px solid var(--border); margin: 20px 0; }
.notes { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 8px; }
.notes strong { display: block; margin-bottom: 6px; font-size: 13px; font-weight: 600; color: var(--muted2); }
.notes p { white-space: pre-wrap; color: var(--muted2); font-size: 14px; line-height: 1.6; }
.section-heading { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.section-heading h2 { font-size: 16px; font-weight: 700; color: var(--text); }

/* ══════════════════════════════════════════════
   Admin — Timeline
   ══════════════════════════════════════════════ */
.timeline { display: flex; flex-direction: column; gap: 14px; }
.timeline-item {
  border-left: 2px solid var(--border);
  padding: 0 0 4px 16px;
  position: relative;
}
.timeline-item::before {
  content: '';
  position: absolute;
  left: -5px; top: 4px;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--border2);
  border: 2px solid var(--surface);
}
.timeline-item:hover::before { background: var(--primary); }
.timeline-meta { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.timeline-meta strong { font-size: 13px; font-weight: 600; color: var(--text); }
.timeline-meta .time { font-size: 11px; color: var(--muted); }
.timeline-actor { margin-top: 3px; display: flex; gap: 8px; align-items: center; }
.timeline-actor small { font-size: 12px; color: var(--muted); font-weight: 500; }
.timeline-actor .ip-addr { font-family: var(--mono); font-size: 11px; color: var(--muted); }
.timeline-details {
  margin-top: 6px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  display: grid;
  gap: 3px;
}
.timeline-detail-item { display: flex; font-size: 12px; line-height: 1.4; }
.detail-key { color: var(--muted); font-weight: 700; width: 100px; flex-shrink: 0; }
.detail-value { color: var(--muted2); font-weight: 500; word-break: break-all; }

/* ══════════════════════════════════════════════
   Admin — Logs page
   ══════════════════════════════════════════════ */
.log-details-box { display: grid; gap: 3px; font-size: 12px; }
.detail-item { display: flex; gap: 6px; }
.ua-text { display: block; max-width: 140px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 11px; }

/* ══════════════════════════════════════════════
   Auth — Login
   ══════════════════════════════════════════════ */
.login-wrap { min-height: 70vh; display: grid; place-items: center; }
.login-card { width: min(400px, 100%); display: grid; gap: 16px; }
.login-card h1 { font-size: 24px; font-weight: 700; letter-spacing: -.02em; }

/* ══════════════════════════════════════════════
   Credential rows (admin detail)
   ══════════════════════════════════════════════ */
.cred-row { display: flex; flex-direction: column; gap: 2px; }
.cred-row dd { display: flex; align-items: center; gap: 8px; }
.cred-value {
  font-family: var(--mono);
  font-size: 13px;
  background: var(--surface2);
  padding: 3px 8px;
  border-radius: 6px;
  word-break: break-all;
  color: var(--primary-l);
}
.cred-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}
.cred-toggle:hover { border-color: var(--primary); color: var(--primary-l); }

/* ══════════════════════════════════════════════
   RTL / Farsi
   ══════════════════════════════════════════════ */
body.rtl {
  direction: rtl;
  text-align: right;
}
body.rtl .nav,
body.rtl .nav nav { flex-direction: row-reverse; }
body.rtl .hero { text-align: right; }
body.rtl .actions { justify-content: flex-start; }
body.rtl .status-visual { flex-direction: row-reverse; }
body.rtl .timeline-item { border-left: none; border-right: 2px solid var(--border); padding: 0 16px 4px 0; }
body.rtl .timeline-item::before { left: auto; right: -5px; }
body.rtl .timeline-meta { flex-direction: row-reverse; }
body.rtl .summary div:nth-child(odd) { padding-right: 0; padding-left: 20px; }
body.rtl .page-heading { flex-direction: row-reverse; }
body.rtl th, body.rtl td { text-align: right; }
body.rtl .tracking-code-wrap { flex-direction: row-reverse; }

/* ══════════════════════════════════════════════
   Responsive
   ══════════════════════════════════════════════ */
@media (max-width: 900px) {
  .metrics { grid-template-columns: 1fr 1fr; }
  .two-columns, .detail-layout { grid-template-columns: 1fr; }
  .filters { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .nav { padding: 12px 0; flex-wrap: wrap; gap: 12px; }
  .nav nav { gap: 4px; flex-wrap: wrap; }
  .page { padding-top: 32px; }
  .form-grid, .summary { grid-template-columns: 1fr; }
  .summary div:nth-child(odd) { padding-right: 0; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .filters { grid-template-columns: 1fr; }
  .page-heading { flex-direction: column; align-items: flex-start; gap: 10px; }
  .card { padding: 20px; }
  .success-card { padding: 32px 20px; }
}

/* ══════════════════════════════════════════════
   Multi-step form
   ══════════════════════════════════════════════ */
.step-bar {
  display: flex;
  align-items: center;
  margin-bottom: 24px;
}
.step-line { flex: 1; height: 1px; background: var(--border); }
.step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border);
  background: var(--surface);
  display: grid; place-items: center;
  font-size: 12px; font-weight: 700;
  color: var(--muted); flex-shrink: 0;
  transition: border-color .2s, background .2s, color .2s;
}
.step-dot.current { border-color: var(--primary); background: rgba(139,92,246,.12); color: var(--primary-l); }
.step-dot.done { border-color: var(--primary); background: var(--primary); color: #fff; }

.step { display: none; }
.step.active { display: block; }

.step-title {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 24px; padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
}
.step-num { font-size: 28px; font-weight: 700; color: var(--primary-l); opacity: .4; letter-spacing: -.03em; line-height: 1; }
.step-label { font-size: 16px; font-weight: 700; color: var(--text); }
.step-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

.step-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 24px; }
.step-fields .full { grid-column: 1 / -1; }

.step-nav { display: flex; justify-content: flex-end; padding-top: 4px; }
.step-nav.two { justify-content: space-between; }

.plan-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; margin-top: 4px; }
.plan-option input[type=radio] { display: none; }
.plan-card {
  display: flex; flex-direction: column; align-items: center;
  padding: 14px 8px; border: 1px solid var(--border);
  border-radius: var(--radius-sm); background: var(--surface2);
  cursor: pointer; transition: border-color .15s, background .15s; gap: 2px;
}
.plan-option input:checked + .plan-card { border-color: var(--primary); background: rgba(139,92,246,.12); }
.plan-card:hover { border-color: var(--border2); }
.plan-months { font-size: 22px; font-weight: 700; color: var(--text); line-height: 1; }
.plan-unit { font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }

.input-error { border-color: var(--danger) !important; box-shadow: 0 0 0 3px rgba(239,68,68,.15) !important; }

.req-star { color: #f87171; font-weight: 700; margin-right: 2px; }
.req-legend { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); margin-top: 2px; }

body.rtl .step-nav { justify-content: flex-start; }
body.rtl .step-nav.two { flex-direction: row-reverse; }
body.rtl .step-title { flex-direction: row-reverse; }
body.rtl .req-star { margin-right: 0; margin-left: 2px; }

@media (max-width: 520px) {
  .step-fields { grid-template-columns: 1fr; }
  .plan-grid { grid-template-columns: repeat(3, 1fr); }
  .backup-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ── Backup code 8-box grid ── */
.backup-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 4px;
}
.backup-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  cursor: text;
}
.backup-num {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: .06em;
}
.backup-input {
  text-align: center;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .08em;
  padding: 10px 6px;
}
