/* ============================================================
   Speed Track Rewards — Register page styles (scoped to .st-page)
   Brand colors:  text #30302E | bg #ffffff | primary #C86437
   Mobile-first, compact, premium landing experience.
   Bilingual: Arabic (Tajawal) + English (Poppins), togglable.
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;500;600;700;800&family=Tajawal:wght@400;500;700;800;900&display=swap');

/* ---------- Language visibility / direction ---------- */
.lang-en { display: none; }
[data-lang="en"] .lang-ar { display: none; }
[data-lang="en"] .lang-en { display: inline; }

[data-lang="en"] .st-page { direction: ltr; }
[data-lang="en"] .st-page { font-family: "Poppins", "Segoe UI", system-ui, sans-serif; }

.st-page {
  --st-ink: #30302E;
  --st-ink-soft: #6b6a66;
  --st-bg: #ffffff;
  --st-surface: #faf9f7;
  --st-primary: #C86437;
  --st-primary-dark: #a94f29;
  --st-primary-soft: #fbeee7;
  --st-border: #ece8e3;
  --st-shadow: 0 18px 50px -22px rgba(48, 48, 46, 0.35);

  direction: rtl;
  min-height: 100vh;
  background:
    radial-gradient(120% 120% at 100% 0%, rgba(200, 100, 55, 0.06) 0%, rgba(255, 255, 255, 0) 45%),
    var(--st-bg);
  color: var(--st-ink);
  font-family: "Tajawal", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

.st-page *,
.st-page *::before,
.st-page *::after { box-sizing: border-box; }

/* ---------- Top brand bar ---------- */
.st-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--st-border);
  background: #fff;
}
.st-header img { height: 46px; width: auto; }
.st-header .st-header-spacer { flex: 1; }

/* ---------- Language selector ---------- */
.st-lang {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.st-lang select {
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: var(--st-ink);
  background: var(--st-primary-soft);
  border: 1px solid rgba(200, 100, 55, 0.28);
  border-radius: 999px;
  padding: 7px 30px 7px 14px;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.st-lang select:focus {
  outline: none;
  border-color: var(--st-primary);
  box-shadow: 0 0 0 3px rgba(200, 100, 55, 0.15);
}
.st-lang::after {
  content: "";
  position: absolute;
  right: 12px;
  top: 50%;
  width: 9px;
  height: 9px;
  margin-top: -5px;
  pointer-events: none;
  background: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23C86437' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ---------- Main wrapper ---------- */
.st-main {
  flex: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 18px 8px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
  align-items: start;
}

/* ---------- Hero ---------- */
.st-hero { text-align: center; }
.st-hero .st-eyebrow {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--st-primary);
  background: var(--st-primary-soft);
  border: 1px solid rgba(200, 100, 55, 0.18);
  padding: 5px 12px;
  border-radius: 999px;
  margin-bottom: 12px;
  font-weight: 700;
}
.st-hero h1 {
  font-size: clamp(1.5rem, 5vw, 2.25rem);
  line-height: 1.18;
  font-weight: 800;
  margin: 0 0 4px;
  color: var(--st-ink);
}
.st-hero p {
  font-size: clamp(0.92rem, 2.6vw, 1.05rem);
  color: var(--st-ink-soft);
  margin: 8px auto 0;
  max-width: 460px;
  line-height: 1.55;
}

/* ---------- Benefit cards ---------- */
.st-benefits {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
.st-benefit {
  background: #fff;
  border: 1px solid var(--st-border);
  border-radius: 14px;
  padding: 12px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}
.st-benefit:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px -16px rgba(48, 48, 46, 0.4);
  border-color: rgba(200, 100, 55, 0.35);
}
.st-benefit .st-ico {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--st-primary-soft);
  color: var(--st-primary);
  font-size: 17px;
}
.st-benefit .st-btxt { line-height: 1.25; }
.st-benefit .st-btxt strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--st-ink);
}
.st-benefit .st-btxt .st-bsub {
  display: block;
  font-size: 11px;
  color: var(--st-ink-soft);
}

/* ---------- Form card ---------- */
.st-card {
  background: linear-gradient(165deg, var(--st-primary) 0%, var(--st-primary-dark) 100%);
  border: 1px solid var(--st-primary-dark);
  border-radius: 18px;
  box-shadow: 0 22px 55px -22px rgba(200, 100, 55, 0.6);
  padding: 22px 22px 24px;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
}
.st-card .st-card-title {
  font-size: 1.15rem;
  font-weight: 800;
  margin: 0 0 2px;
  color: #ffffff;
  text-align: start;
}
.st-card .st-card-sub {
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 16px;
  text-align: start;
}

.st-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fdecea;
  color: #b3261e;
  border: 1px solid #f5c2bd;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 14px;
  text-align: start;
}
.st-alert .st-alert-text { flex: 1; }
.st-alert .st-alert-close {
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: #b3261e;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s ease;
}
.st-alert .st-alert-close:hover { background: rgba(179, 38, 30, 0.12); }

/* ---------- Compact form fields ---------- */
.st-page .form-group { margin-bottom: 12px; }
.st-label {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #ffffff;
  margin-bottom: 5px;
  text-align: start;
}
.st-label small { font-weight: 400; color: rgba(255, 255, 255, 0.8); }

/* Form fields & hints follow the active reading direction */
.st-page .form-control { text-align: start; }
.st-field-hint {
  display: block;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
  margin-top: 4px;
  text-align: start;
}

/* "(optional)" tag next to a label */
.st-optional {
  font-weight: 400;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.7);
}

/* Plate number: two side-by-side fields (works in RTL & LTR) */
.st-plate-row {
  display: flex;
  gap: 10px;
}
.st-plate-col { flex: 1; }
.st-page .st-plate-input {
  text-align: center;
  letter-spacing: 1px;
  font-weight: 600;
}
.st-plate-col .st-field-hint { text-align: center; }

.st-page .form-control,
.st-page select.form-control {
  height: 42px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--st-ink);
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: 10px;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.st-page .form-control::placeholder { color: #a8a59f; }
.st-page .form-control:focus,
.st-page select.form-control:focus {
  outline: none;
  background: #fff;
  border-color: var(--st-primary);
  box-shadow: 0 0 0 3px rgba(200, 100, 55, 0.15);
}
.st-page select.form-control {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2330302E' stroke-width='3' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: left 12px center;
  padding-left: 34px;
}
[data-lang="en"] .st-page select.form-control {
  background-position: right 12px center;
  padding-left: 12px;
  padding-right: 34px;
}
.st-page .text-danger { color: #ffd9cf !important; }

/* intl-tel-input full width inside the card */
.st-page .iti { width: 100%; }
.st-page .iti.iti--allow-dropdown.iti--separate-dial-code { width: 100% !important; }
.st-page .iti input#phone { height: 42px; border-radius: 10px; }

/* ---------- Gender: segmented pill control ---------- */
.st-segmented {
  display: flex;
  gap: 8px;
}
.st-segmented input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  pointer-events: none;
}
.st-segmented label {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin: 0;
  height: 42px;
  border: 1px solid var(--st-border);
  border-radius: 10px;
  background: var(--st-surface);
  color: var(--st-ink-soft);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  user-select: none;
  transition: border-color 0.15s ease, background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.st-segmented label .st-emoji { font-size: 16px; line-height: 1; }
.st-segmented label:hover { border-color: rgba(200, 100, 55, 0.4); }
.st-segmented input:checked + label {
  background: var(--st-primary-soft);
  border-color: var(--st-primary);
  color: var(--st-primary);
  box-shadow: 0 0 0 3px rgba(200, 100, 55, 0.12);
}
.st-segmented input:focus-visible + label {
  border-color: var(--st-primary);
  box-shadow: 0 0 0 3px rgba(200, 100, 55, 0.18);
}

/* ---------- Terms ---------- */
.st-terms {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0 16px;
  font-size: 12.5px;
  color: rgba(255, 255, 255, 0.9);
}
.st-terms input { width: 16px; height: 16px; accent-color: #ffffff; }
.st-terms a { color: #ffffff; font-weight: 700; text-decoration: underline; }
.st-terms a:hover { opacity: 0.85; }

/* ---------- Join Now button ---------- */
.st-page .st-join-btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 18px;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: 0.3px;
  color: var(--st-primary-dark);
  background: #ffffff;
  box-shadow: 0 14px 28px -14px rgba(48, 48, 46, 0.55);
  cursor: pointer;
  transition: transform 0.12s ease, box-shadow 0.12s ease, filter 0.12s ease;
}
.st-page .st-join-btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.02);
  box-shadow: 0 18px 34px -14px rgba(48, 48, 46, 0.6);
}
.st-page .st-join-btn:active { transform: translateY(0); }

.st-login-link {
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.9);
  margin: 14px 0 0;
}
.st-login-link a { color: #ffffff; font-weight: 700; text-decoration: underline; }
.st-login-link a:hover { text-decoration: underline; }

.st-invalid-url {
  text-align: center;
  font-size: 1rem;
  font-weight: 700;
  color: #ffffff;
  padding: 10px 0;
}

/* ---------- Footer ---------- */
.st-footer {
  margin-top: 18px;
  border-top: 1px solid var(--st-border);
  background: #fff;
  padding: 18px;
  text-align: center;
}
.st-footer img { height: 40px; width: auto; margin-bottom: 8px; }
.st-footer p { margin: 0; font-size: 12px; color: var(--st-ink-soft); }
.st-footer .st-footer-tag { color: var(--st-primary); font-weight: 700; }

/* ---------- Desktop: two-column, low-scroll layout ---------- */
@media (min-width: 900px) {
  .st-main {
    grid-template-columns: 1.05fr 0.95fr;
    gap: 40px;
    padding-top: 40px;
    align-items: center;
  }
  .st-hero { text-align: start; }
  .st-hero p { margin-inline: 0; }
  .st-intro { padding-left: 8px; }
  .st-benefits { margin-top: 22px; }
  .st-card { margin: 0; }
}

/* ---------- Small phones ---------- */
@media (max-width: 360px) {
  .st-benefits { grid-template-columns: 1fr; }
  .st-card { padding: 18px 16px 20px; }
}

/* ============================================================
   OTP verify page (reuses .st-page / .st-card)
   ============================================================ */
.st-page .st-center { text-align: center !important; }

/* Single centered column, even on desktop */
.st-main.st-otp-main,
.st-main.st-narrow {
  grid-template-columns: 1fr;
  max-width: 520px;
  justify-items: center;
  padding-top: 28px;
}

/* Circular icon on top of the card */
.st-card-icon {
  width: 56px;
  height: 56px;
  margin: 2px auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #ffffff;
  color: var(--st-primary);
  font-size: 26px;
  box-shadow: 0 8px 18px -10px rgba(48, 48, 46, 0.5);
}

/* 6-digit OTP boxes */
.st-otp-group {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin: 10px 0 4px;
}
.st-otp-input {
  width: 46px;
  height: 54px;
  border: 1px solid var(--st-border);
  border-radius: 12px;
  background: #ffffff;
  color: var(--st-ink);
  font-size: 22px;
  font-weight: 800;
  text-align: center;
  caret-color: var(--st-primary);
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}
.st-otp-input:focus {
  outline: none;
  border-color: var(--st-primary-dark);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.55);
  transform: translateY(-1px);
}

@media (max-width: 360px) {
  .st-otp-input { width: 40px; height: 48px; font-size: 19px; }
  .st-otp-group { gap: 6px; }
}

/* ---------- Success popup ---------- */
.st-success-overlay {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(48, 48, 46, 0.55);
  backdrop-filter: blur(3px);
  animation: stFade 0.25s ease;
}
.st-success-box {
  background: #fff;
  border-radius: 20px;
  padding: 30px 26px 26px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 30px 70px -25px rgba(48, 48, 46, 0.6);
  animation: stPop 0.3s ease;
}
.st-success-check {
  width: 72px;
  height: 72px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 34px;
  background: linear-gradient(180deg, #34c759 0%, #248a3d 100%);
  box-shadow: 0 12px 26px -12px rgba(36, 138, 61, 0.8);
}
.st-success-title {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--st-ink);
  margin: 0 0 6px;
}
.st-success-text {
  font-size: 13px;
  color: var(--st-ink-soft);
  margin: 0 0 18px;
}
.st-success-btn {
  display: inline-block;
  text-decoration: none;
  font-weight: 800;
  font-size: 15px;
  color: #fff;
  background: linear-gradient(180deg, var(--st-primary) 0%, var(--st-primary-dark) 100%);
  padding: 12px 26px;
  border-radius: 12px;
  box-shadow: 0 12px 24px -12px rgba(200, 100, 55, 0.7);
}
.st-success-btn:hover { filter: brightness(1.04); }

@keyframes stFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes stPop {
  from { opacity: 0; transform: translateY(10px) scale(0.96); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* ============================================================
   Loyalty dashboard (index.php) — reuses .st-page / .st-card
   ============================================================ */
.st-greeting-hi {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  text-align: center;
}
.st-greeting-name {
  margin: 2px 0 10px;
  font-size: 1.4rem;
  font-weight: 800;
  color: #ffffff;
  text-align: center;
  word-break: break-word;
}
.st-remaining {
  margin: 0 0 4px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: #ffffff;
}
.st-remaining-num {
  display: inline-block;
  min-width: 30px;
  margin: 0 4px;
  padding: 0 8px;
  font-size: 18px;
  font-weight: 900;
  color: var(--st-primary-dark);
  background: #ffffff;
  border-radius: 8px;
}

/* White inner panel that holds the stamps and QR */
.st-loyalty-panel {
  background: #ffffff;
  border-radius: 16px;
  padding: 18px 16px;
  margin: 14px 0 16px;
  text-align: center;
  box-shadow: inset 0 0 0 1px rgba(48, 48, 46, 0.05);
}
.st-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 10px;
}
.st-stamp { width: 42px; height: 42px; object-fit: contain; }
.st-stamp.is-empty { opacity: 0.22; filter: grayscale(0.4); }

.st-promo-img { max-width: 200px; width: 100%; height: auto; margin: 6px auto; display: block; }
.st-qr {
  width: 200px;
  max-width: 80%;
  height: auto;
  margin: 8px auto;
  display: block;
  border-radius: 10px;
}
.st-qr-hint {
  margin: 6px 0 0;
  font-size: 12px;
  color: var(--st-ink-soft);
}
.st-gift-form { margin-top: 10px; }
.st-member-id {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--st-ink-soft);
}
.st-member-id strong { color: var(--st-ink); letter-spacing: 0.5px; }

/* Ghost (secondary) button on the orange card */
.st-page .st-btn-ghost {
  display: block;
  width: 100%;
  margin-top: 10px;
  background: transparent;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease;
}
.st-page .st-btn-ghost:hover { background: rgba(255, 255, 255, 0.14); }

/* ---------- Invite modal ---------- */
.st-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(48, 48, 46, 0.55);
  backdrop-filter: blur(3px);
}
.st-modal-box {
  background: #fff;
  border-radius: 20px;
  padding: 26px 24px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 30px 70px -25px rgba(48, 48, 46, 0.6);
  animation: stPop 0.3s ease;
}
.st-invite-input {
  width: 100%;
  height: 42px;
  margin-top: 6px;
  padding: 8px 12px;
  font-size: 13px;
  text-align: center;
  color: var(--st-ink);
  background: var(--st-surface);
  border: 1px solid var(--st-border);
  border-radius: 10px;
}
.st-invite-input:focus { outline: none; border-color: var(--st-primary); }
.st-modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.st-btn-text {
  background: transparent;
  border: none;
  color: var(--st-ink-soft);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  padding: 8px;
}
.st-btn-text:hover { color: var(--st-ink); }
