/* ── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

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

:root {
  --teal-dark:   #0b4f4e;
  --teal:        #1a7a78;
  --teal-light:  #22928f;
  --teal-glow:   rgba(26, 122, 120, 0.25);
  --gold:        #c8a84b;
  --gold-light:  #dfc06a;
  --gold-glow:   rgba(200, 168, 75, 0.22);
  --overlay-bg:  rgba(5, 28, 28, 0.82);
  --surface:     #ffffff;
  --surface-2:   #f0f7f7;
  --border:      #b8d8d7;
  --success:     #1a7a78;
  --success-bg:  rgba(26, 122, 120, 0.10);
  --error:       #c0392b;
  --error-bg:    rgba(192, 57, 43, 0.09);
  --text-primary:   #0d2f2e;
  --text-secondary: #3a6e6d;
  --text-muted:     #7aadac;
  --radius:      12px;
  --font: 'Cairo', 'Segoe UI', system-ui, sans-serif;
}

/* ── Page: simulate site backdrop ─────────────────────────────────────────── */
body {
  font-family: var(--font);
  background: linear-gradient(160deg, var(--teal-dark) 0%, #0d3b3a 60%, #091f1f 100%);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  direction: rtl;
}

/* ── Popup / Modal card ────────────────────────────────────────────────────── */
.page-wrapper {
  width: 100%;
  max-width: 460px;
  position: relative;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(200,168,75,.18);
}

/* Gold top bar — brand signature */
.card::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--teal-light), var(--gold), var(--teal-light));
}

.card-body {
  padding: 2.25rem 2rem 2rem;
}

.card-success {
  box-shadow: 0 32px 80px rgba(0,0,0,.55), 0 0 0 1px rgba(26,122,120,.35);
}
.card-success::before {
  background: linear-gradient(90deg, var(--teal), var(--gold));
}

/* ── Card header ───────────────────────────────────────────────────────────── */
.card-header {
  text-align: center;
  margin-bottom: 1.75rem;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  background: var(--teal-dark);
  color: #fff;
  border-radius: 8px;
  padding: .45rem .9rem;
  margin-bottom: 1.1rem;
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .04em;
}
.brand-badge svg {
  width: 18px; height: 18px;
  stroke: var(--gold);
}

.icon-circle {
  width: 58px; height: 58px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 2px solid var(--border);
  display: inline-flex;
  align-items: center; justify-content: center;
  margin-bottom: .9rem;
}
.icon-circle svg { width: 26px; height: 26px; stroke: var(--teal); }
.icon-circle.success {
  background: var(--success-bg);
  border-color: var(--teal-light);
}
.icon-circle.success svg { stroke: var(--teal); }

.card-header h1 {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--teal-dark);
  margin-bottom: .4rem;
  letter-spacing: -.01em;
}
.card-header p {
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.65;
}
.card-header p strong { color: var(--teal-dark); font-weight: 700; }

/* ── Form fields ───────────────────────────────────────────────────────────── */
.field-group { margin-bottom: 1.2rem; }
.field-group label {
  display: block;
  font-size: .8rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .05em;
  margin-bottom: .4rem;
}

.input {
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 8px;
  color: var(--text-primary);
  font-size: 1rem;
  font-family: var(--font);
  padding: .72rem 1rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
  direction: ltr;
  text-align: right;
}
.input:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
}

/* ── Buttons ───────────────────────────────────────────────────────────────── */
.btn {
  display: flex;
  align-items: center; justify-content: center;
  font-family: var(--font);
  font-size: .95rem;
  font-weight: 700;
  border: none;
  border-radius: 8px;
  padding: .8rem 1.5rem;
  cursor: pointer;
  transition: background .18s, transform .1s, box-shadow .18s;
  text-decoration: none;
  letter-spacing: .01em;
  box-sizing: border-box;
  outline: none;
}

/* asp:Button renders as <input type="submit">, a replaced element —
   flexbox cannot align its internal value text, so center it via
   text-align/line-height instead. */
input[type="submit"].btn,
input[type="button"].btn {
  display: block;
  text-align: center;
  line-height: normal;
  -webkit-appearance: none;
  appearance: none;
}

.btn:focus-visible {
  box-shadow: 0 0 0 3px var(--teal-glow);
}
.btn-full {
  width: 100%;
  margin: .25rem 0 0;
}

form { display: block; width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--teal) 0%, var(--teal-dark) 100%);
  color: #fff;
  box-shadow: 0 4px 18px var(--teal-glow);
  transition: filter .18s, box-shadow .18s, transform .1s;
}
.btn-primary:hover {
  filter: brightness(1.12);
  box-shadow: 0 6px 24px var(--teal-glow);
}
.btn-primary:active { transform: scale(.98); filter: brightness(1.05); }

.btn-outline {
  background: transparent;
  color: var(--teal);
  border: 1.5px solid var(--teal);
  transition: background .18s, transform .1s;
}
.btn-outline:hover { background: var(--success-bg); }
.btn-outline:active { transform: scale(.98); }

/* ── OTP digit boxes ───────────────────────────────────────────────────────── */
.otp-boxes {
  display: flex;
  gap: .5rem;
  justify-content: center;
  margin-bottom: 1.5rem;
  direction: ltr;
}

.otp-digit {
  width: 52px; height: 62px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 10px;
  color: var(--teal-dark);
  font-size: 1.55rem;
  font-weight: 800;
  text-align: center;
  font-family: 'Courier New', monospace;
  outline: none;
  transition: border-color .15s, box-shadow .15s, transform .12s;
  caret-color: transparent;
}
.otp-digit:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px var(--teal-glow);
  transform: translateY(-2px);
  background: #fff;
}
/* Gold highlight on filled digit */
.otp-digit:not(:placeholder-shown) {
  border-color: var(--gold);
  color: var(--teal-dark);
}

/* ── Messages ──────────────────────────────────────────────────────────────── */
.block-msg {
  display: block;
  padding: .65rem 1rem;
  border-radius: 8px;
  font-size: .88rem;
  margin-bottom: 1rem;
  font-weight: 600;
}
.success-msg {
  background: var(--success-bg);
  color: var(--teal-dark);
  border: 1px solid rgba(26,122,120,.25);
}
.error-msg {
  background: var(--error-bg);
  color: var(--error);
  border: 1px solid rgba(192,57,43,.2);
  font-size: .82rem;
  margin-top: .3rem;
  display: block;
}

.attempts-label {
  display: block;
  text-align: center;
  font-size: .82rem;
  color: var(--text-muted);
  margin-bottom: .8rem;
}

/* ── Countdown ─────────────────────────────────────────────────────────────── */
.countdown {
  font-weight: 800;
  color: var(--teal);
  font-variant-numeric: tabular-nums;
}
.countdown.expired { color: var(--error); }

/* ── Resend row ────────────────────────────────────────────────────────────── */
.resend-row {
  text-align: center;
  margin-top: 1.2rem;
  font-size: .85rem;
  color: var(--text-muted);
}
.link-btn {
  color: var(--teal);
  background: none;
  border: none;
  cursor: pointer;
  font-family: var(--font);
  font-size: .85rem;
  font-weight: 700;
  text-decoration: none;
}
.link-btn:hover { text-decoration: underline; color: var(--teal-light); }

/* ── Footer brand strip ────────────────────────────────────────────────────── */
.card-footer {
  background: var(--teal-dark);
  padding: .65rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
}
.card-footer span {
  color: rgba(255,255,255,.55);
  font-size: .75rem;
}
.card-footer strong {
  color: var(--gold);
  font-size: .8rem;
}

/* ── Dev hint ──────────────────────────────────────────────────────────────── */
.dev-hint {
  position: fixed;
  bottom: 1.25rem;
  left: 50%; transform: translateX(-50%);
  background: #2a2318;
  border: 1px solid #6b5c30;
  color: #f0c674;
  border-radius: 8px;
  padding: .6rem 1.2rem;
  font-size: .85rem;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .card-body { padding: 1.75rem 1.25rem 1.5rem; }
  .otp-digit { width: 44px; height: 54px; font-size: 1.3rem; }
  .otp-boxes { gap: .35rem; }
}
