/* ── tokens ────────────────────────────────────────────────────────────────── */
/* Palette is taken from the ATHR mark: teal ribbon + charcoal diamonds. */
:root {
  color-scheme: light;

  /* --teal-500 and --ink are sampled straight out of logo.png. */
  --teal-50:  #f1faf9;
  --teal-100: #dcf3f0;
  --teal-300: #96dbd2;
  --teal-500: #15ae9c;
  --teal-600: #118f80;
  --teal-700: #0d6f64;

  --ink: #22252a;

  --bg: var(--teal-50);
  --surface: #ffffff;
  --border: #dce9e7;
  --text: var(--ink);
  --muted: #5d6f74;
  --danger: #b42318;
  --danger-bg: #fef3f2;
  --danger-border: #fda29b;

  --radius: 14px;
  --radius-sm: 10px;
  --gap: 18px;
  --shadow: 0 1px 2px rgba(34, 37, 42, .05), 0 12px 32px -12px rgba(17, 143, 128, .25);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* Arabic reads better with a face that actually has Arabic glyphs. */
[dir="rtl"] body,
body:lang(ar) {
  font-family: "Noto Sans Arabic", "Segoe UI", Tahoma, "Geeza Pro", "Arabic Typesetting",
    ui-sans-serif, system-ui, sans-serif;
}

/* ── layout ────────────────────────────────────────────────────────────────── */
.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 48px 20px 72px;
}

/* ── brand ─────────────────────────────────────────────────────────────────── */
.brand { display: flex; align-items: center; gap: 14px; margin-bottom: 28px; }
.brand__text { flex: 1; min-width: 0; }

.brand__logo {
  flex: none;
  width: 80px;
  height: auto;
  display: block;
}

/* The lockup already carries the wordmark, so the <h1> is sr-only and the
   tagline is the only text beside it. */
.brand__tagline { margin: 0; color: var(--muted); font-size: 15px; }

/* ── language toggle ───────────────────────────────────────────────────────── */
.lang {
  flex: none;
  padding: 7px 14px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--teal-600);
  font-size: 14px; font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
  transition: border-color .15s, background .15s;
}

.lang:hover { border-color: var(--teal-300); background: var(--teal-50); }
.lang:focus-visible { outline: 3px solid var(--teal-300); outline-offset: 2px; }

/* ── card & sections ───────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 8px 24px 24px;
}

.section { padding: 20px 0; border-bottom: 1px solid var(--border); }
.section:last-of-type { border-bottom: 0; }

.section__title {
  margin: 0 0 14px;
  font-size: 13px; font-weight: 650;
  text-transform: uppercase; letter-spacing: .06em;
  color: var(--muted);
}

.section__optional {
  text-transform: none; letter-spacing: 0;
  font-weight: 400; font-size: 12px;
  color: var(--muted); opacity: .8;
}

/* ── fields ────────────────────────────────────────────────────────────────── */
.grid { display: grid; gap: var(--gap); }
.grid--2 { grid-template-columns: 1fr 1fr; }
.field--span { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field--grow { flex: 1; }

label { font-size: 13px; font-weight: 550; color: var(--muted); }

input, select {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color .15s, box-shadow .15s;
}

input::placeholder { color: var(--muted); opacity: .6; }

input:focus, select:focus {
  outline: none;
  border-color: var(--teal-500);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--teal-500) 22%, transparent);
}

.amount { display: flex; gap: 12px; align-items: flex-end; }
.amount .field:last-child { width: 110px; flex: none; }
[dir="rtl"] #amount { text-align: right; }
#amount { font-size: 20px; font-weight: 600; letter-spacing: -.01em; }

.hint { margin: 12px 0 0; font-size: 13px; color: var(--muted); }
.hint strong { color: var(--text); }

/* ── submit ────────────────────────────────────────────────────────────────── */
.submit {
  width: 100%;
  margin-top: 22px;
  padding: 14px 18px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--teal-500);
  color: #fff;
  font: inherit; font-weight: 600; font-size: 16px;
  cursor: pointer;
  transition: background .15s, transform .05s;
}

.submit:hover { background: var(--teal-600); }
.submit:active { transform: translateY(1px); }
.submit:focus-visible { outline: 3px solid var(--teal-300); outline-offset: 2px; }

.secured { margin: 12px 0 0; text-align: center; font-size: 12.5px; color: var(--muted); }

/* ── alert ─────────────────────────────────────────────────────────────────── */
.alert {
  margin-bottom: 20px;
  padding: 14px 16px;
  border: 1px solid var(--danger-border);
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  font-size: 14px;
}

.alert ul { margin: 6px 0 0; padding-inline-start: 18px; }

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

@media (max-width: 520px) {
  .page { padding: 32px 16px 56px; }
  .card { padding: 4px 16px 20px; }
  .grid--2 { grid-template-columns: 1fr; }
  .brand__logo { width: 84px; }
}
