/* SAHRA Premium web checkout. Same Midnight Violet tokens and fonts as the public site (site/style.css). */
@font-face {
  font-family: "Inter";
  src: url("fonts/Inter-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Alexandria";
  src: url("fonts/Alexandria-Variable.ttf") format("truetype");
  font-weight: 100 900;
  font-display: swap;
}

/* Yellow only marks the current page and keyboard focus, as on the site and in the app. */
:root {
  --bg: #140f22;
  --surface: #241b3a;
  --panel: rgba(36, 27, 58, 0.72);
  --field: rgba(20, 15, 34, 0.7);
  --line: rgba(185, 167, 230, 0.16);
  --line-strong: rgba(185, 167, 230, 0.38);
  --text: #ffffff;
  --muted: #a99fc4;
  --accent: #c9bdf0;
  --hover: #ffffff;
  --active: #e8ff3a;
  --on-accent: #140f22;
  --ok-line: rgba(140, 230, 170, 0.5);
  --ok-bg: rgba(110, 220, 150, 0.1);
  --ok-text: #d4f7e0;
  --error-line: rgba(255, 140, 140, 0.55);
  --error-bg: rgba(255, 110, 110, 0.1);
  --error-text: #ffd6d6;
  color-scheme: dark;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

/* Both languages are in the HTML; with JavaScript only the chosen one shows. */
html.js[lang="ar"] [data-lang="en"],
html.js:not([lang="ar"]) [data-lang="ar"] { display: none !important; }
html:not(.js) .needs-js { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: radial-gradient(1200px 600px at 85% -10%, rgba(108, 85, 201, 0.28), transparent 60%),
    radial-gradient(900px 500px at -10% 110%, rgba(185, 167, 230, 0.08), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.6;
}
:lang(ar) { font-family: "Alexandria", "Inter", system-ui, sans-serif; }
html[dir="rtl"] body { line-height: 1.8; }

a { color: var(--accent); text-underline-offset: 3px; }
a:hover { color: var(--hover); }
a:focus-visible,
button:focus-visible,
input:focus-visible { outline: 2px solid var(--active); outline-offset: 3px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ------------------------------------------------------------------ header */
.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 20px 20px 8px;
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 18px; }
.brand img { border-radius: 9px; }
.top nav { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 18px; font-size: 15px; }
.top nav a { color: var(--muted); text-decoration: none; padding: 4px 0; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--text); }
.top nav a[aria-current="page"] { box-shadow: inset 0 -2px 0 var(--active); }
.lang {
  font: inherit;
  font-size: 15px;
  color: var(--accent);
  background: none;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
}
.lang:hover { color: var(--hover); }
html:not(.js) .lang { display: none; }

main { max-width: 760px; margin: 0 auto; padding: 0 20px 48px; }

/* ------------------------------------------------------------------ hero */
.hero { text-align: center; padding: 28px 0 8px; }
.hero h1 { font-size: clamp(30px, 6vw, 46px); line-height: 1.15; margin: 0 0 8px; letter-spacing: -0.02em; }
html[dir="rtl"] .hero h1 { letter-spacing: 0; }
.lead { font-size: clamp(18px, 2.6vw, 22px); margin: 0 auto 6px; max-width: 34ch; }
.muted { color: var(--muted); }
.small { font-size: 14px; }

/* ------------------------------------------------------------------ cards */
.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 20px 22px;
  margin: 16px 0;
}
.card > h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 19px;
  line-height: 1.3;
  margin: 0 0 14px;
}
.card p { margin: 8px 0; }
.step {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
}

/* ------------------------------------------------------------------ plans and currency */
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.group-label { display: block; font-size: 14px; color: var(--muted); margin: 0 0 6px; padding: 0; }

.currency { margin: 0 0 14px; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--field);
  cursor: pointer;
  font-size: 15px;
}
.pill.is-selected { border-color: var(--accent); background: rgba(108, 85, 201, 0.22); }

.plans { display: grid; gap: 10px; }
.plan {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 12px;
  align-items: start;
  padding: 14px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--field);
  cursor: pointer;
}
.plan.is-selected { border-color: var(--accent); background: rgba(108, 85, 201, 0.22); }
.plan.is-disabled { opacity: 0.55; cursor: not-allowed; }
/* Read-only prices while the checkout isn't open: no radio buttons, nothing to click. */
.price-list { list-style: none; margin: 0; padding: 0; }
.price-list .plan { grid-template-columns: 1fr; cursor: default; }
.price-list .plan.is-disabled { cursor: default; }
.plan input { margin-top: 5px; }
.plan-body { display: flex; flex-direction: column; min-width: 0; }
.plan-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; }
.plan-name { font-weight: 700; font-size: 17px; }
.plan-price { font-weight: 700; font-size: 20px; }
.plan-note { color: var(--muted); font-size: 14px; }
html[lang="ar"] .plan-price { font-size: 18px; }

input[type="radio"],
input[type="checkbox"] { accent-color: var(--accent); width: 20px; height: 20px; flex: none; margin: 0; }

/* ------------------------------------------------------------------ forms */
.mode {
  display: flex;
  gap: 4px;
  padding: 4px;
  margin: 0 0 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}
.mode button {
  flex: 1;
  min-height: 44px;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 15px;
  cursor: pointer;
}
.mode button:hover { color: var(--text); }
.mode button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: inset 0 0 0 1px var(--line-strong); }

.field { display: block; margin: 14px 0 4px; font-weight: 600; font-size: 15px; }
input[type="email"],
input[type="password"],
input[type="text"] {
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-family: "Inter", system-ui, sans-serif;
}
input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus { border-color: var(--accent); }
input[aria-invalid="true"] { border-color: var(--error-line); }
html[dir="rtl"] input[dir="ltr"] { text-align: right; }
.code-input { letter-spacing: 0.12em; text-transform: uppercase; max-width: 14em; }
.hint { font-size: 14px; color: var(--muted); margin: 4px 0 0; }

.check { display: flex; gap: 10px; align-items: flex-start; margin: 14px 0; cursor: pointer; }
.check input { margin-top: 4px; }
.check.small { font-size: 15px; margin: 10px 0; }
.check.small input { margin-top: 3px; }

/* ------------------------------------------------------------------ buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 11px 22px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}
.btn.primary { background: var(--accent); color: var(--on-accent); }
.btn.primary:hover { background: var(--hover); color: var(--on-accent); }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn.secondary:hover { border-color: var(--accent); color: var(--text); }
.btn.block { width: 100%; }
.btn.big { min-height: 54px; font-size: 18px; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn.primary:disabled:hover { background: var(--accent); }
.btn.is-busy::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-inline-end-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.linkbtn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.linkbtn:hover { color: var(--hover); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0 0; }

/* ------------------------------------------------------------------ notices */
.notice {
  margin: 12px 0;
  padding: 10px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: var(--field);
  font-size: 15px;
}
.notice.error { border-color: var(--error-line); background: var(--error-bg); color: var(--error-text); }
.notice.ok { border-color: var(--ok-line); background: var(--ok-bg); color: var(--ok-text); }

/* ------------------------------------------------------------------ summary, badges */
.summary { display: grid; grid-template-columns: auto 1fr; gap: 4px 16px; margin: 0 0 8px; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.signed-in-line { overflow-wrap: anywhere; }

.badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 6px; padding: 0; }
.badges li {
  padding: 3px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--field);
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

/* ------------------------------------------------------------------ order status (done.html) */
.status { text-align: center; padding: 8px 0; }
.status h2 { font-size: 22px; line-height: 1.3; margin: 0 0 8px; }
.spinner {
  width: 40px;
  height: 40px;
  margin: 8px auto 16px;
  border: 3px solid var(--line-strong);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}
.mark {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin: 4px auto 14px;
  border-radius: 50%;
  font-size: 28px;
  font-weight: 700;
  border: 2px solid var(--line-strong);
}
.mark.ok { border-color: var(--ok-line); color: var(--ok-text); background: var(--ok-bg); }
.mark.error { border-color: var(--error-line); color: var(--error-text); background: var(--error-bg); }
.status .actions { justify-content: center; }
.order-box { margin: 18px 0 0; padding: 14px 16px; border-top: 1px solid var(--line); }

@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spinner, .btn.is-busy::after { animation-duration: 3s; }
}

/* ------------------------------------------------------------------ prose and legal pages */
.about { margin: 32px 0 0; }
.about h2, .doc h2 { font-size: 20px; margin: 28px 0 8px; }
.doc { max-width: 760px; margin: 0 auto; }
article.doc { padding-top: 16px; }
.doc h1 { font-size: clamp(28px, 5vw, 40px); line-height: 1.15; margin: 20px 0 8px; letter-spacing: -0.02em; }
html[dir="rtl"] .doc h1, .doc h1:lang(ar) { letter-spacing: 0; }
.doc ul { padding-inline-start: 22px; }
.doc li { margin: 6px 0; }
article.doc + article.doc { margin-top: 48px; padding-top: 24px; border-top: 1px solid var(--line); }
html.js article.doc + article.doc { margin-top: 0; border-top: 0; }

/* ------------------------------------------------------------------ footer */
footer { border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 14px; padding: 20px; }
footer p { margin: 6px 0 0; }
.foot-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 18px; }

/* ------------------------------------------------------------------ wider screens */
@media (min-width: 600px) {
  .plans { grid-template-columns: repeat(3, 1fr); }
  .plan { grid-template-columns: 1fr; }
  .plan input { margin: 0 0 6px; }
  .plan-head { flex-direction: column; align-items: flex-start; }
}

/* ------------------------------------------------------------------ phones: 16px side gutter */
@media (max-width: 640px) {
  body { font-size: 16px; }
  .top { padding: 16px 16px 6px; }
  main { padding: 0 16px 40px; }
  .card { padding: 16px; }
  footer { padding: 18px 16px; }
}
