/* ============================================================
   Visa x Al Rajhi — World Cup Viewing Party registration
   ============================================================ */

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

:root {
  --navy: #0b1646;
  --field-bg: rgba(129, 156, 235, 0.5);
  --knob: rgba(34, 57, 156, 0.95);
  --track: rgba(120, 120, 120, 0.25);
  --track-on: rgba(129, 156, 235, 0.9);
  --white: #ffffff;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body {
  background: var(--navy);
  color: var(--white);
  font-family: 'Montserrat', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  overflow-x: hidden;
}

/* Phone-sized stage, centred on larger screens */
.stage {
  position: relative;
  width: 100%;
  max-width: 440px;
  height: 100vh;
  height: 100dvh;
  background: var(--navy);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* On desktop: cap at a phone-like height so bg-art stays close to content */
@media (min-width: 480px) and (min-height: 600px) {
  .stage {
    height: min(100dvh, 812px);
    border-radius: 16px;
  }
}

/* Decorative background art, anchored to the bottom */
.bg-art {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  aspect-ratio: 440.5 / 677.577;  /* svg uses preserveAspectRatio=none */
  height: auto;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* Everything sits above the art */
.header,
.content { position: relative; z-index: 1; }

/* ---------- Header / logos ---------- */
.header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 24px;
}
/* alrajhi svg has preserveAspectRatio=none + viewBox 150x53 -> set both */
.header .alrajhi { width: 150px; height: 53px; }
.header .visa    { height: 56px; width: auto; }

/* ---------- Content area ---------- */
.content {
  padding: 0 24px 40px;
  display: flex;
  flex-direction: column;
}

.title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 32px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  margin: 24px 0 64px;
}

/* ---------- Form ---------- */
form { display: flex; flex-direction: column; }

.fields {
  display: flex;
  flex-direction: column;
  gap: 30px;
  align-items: stretch;
}

/* Language pill (right aligned) */
.lang-row { display: flex; justify-content: flex-end; }
.lang-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 40px;
  padding: 12px 20px;
  border: 0.5px solid var(--white);
  border-radius: 40px;
  background: transparent;
  color: var(--white);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}
.lang-btn img { width: 18px; height: 18px; }

/* Text inputs */
.field {
  width: 100%;
  height: 60px;
  padding: 10px 22px;
  border: none;
  border-radius: 14px;
  background: var(--field-bg);
  color: var(--white);
  font-family: inherit;
  font-size: 18px;
}
.field::placeholder { color: rgba(255, 255, 255, 0.95); opacity: 1; }
.field:focus { outline: 2px solid rgba(255, 255, 255, 0.6); }

/* Toggle / checkbox row */
.toggle-row {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 18px;
  opacity: 0.55;
  transition: opacity 0.2s ease;
}
.toggle-row:has([aria-checked="true"]) { opacity: 1; }
.toggle {
  position: relative;
  width: 40px;
  height: 22px;
  flex: 0 0 auto;
  border-radius: 20px;
  background: rgba(129, 156, 235, 0.4);
  border: none;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s ease;
}
.toggle .knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--white);
  transition: transform 0.2s ease;
  opacity: 0.9;
}
.toggle[aria-checked="true"] {
  background: rgba(129, 156, 235, 0.95);
  outline: 2px solid rgba(255, 255, 255, 0.75);
  outline-offset: 2px;
  box-shadow: 0 0 10px rgba(129, 156, 235, 0.7);
}
.toggle[aria-checked="true"] .knob { transform: translateX(18px); }
.toggle-row label { cursor: pointer; }

/* Submit */
.submit {
  width: 100%;
  height: 60px;
  margin-top: 64px;
  border-radius: 14px;
  background: var(--navy);
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: var(--white);
  font-family: inherit;
  font-weight: 500;
  font-size: 18px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  cursor: pointer;
  transition: transform 0.05s ease, background 0.2s ease;
}
.submit:hover { background: #122057; }
.submit:active { transform: scale(0.99); }
.submit:disabled { opacity: 0.6; cursor: default; }

/* Inline error text */
.error {
  min-height: 18px;
  margin-top: 14px;
  font-size: 13px;
  color: #ffd2d2;
  text-align: center;
}

/* ---------- Thank-you screen ---------- */
.content.ty-mode {
  flex: 1;
  justify-content: center;
  padding-bottom: 80px;
}

.thankyou {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
  padding: 48px 28px;
  border-radius: 24px;
  background: rgba(100, 130, 220, 0.22);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.18);
}
.thankyou.show { display: flex; }
.thankyou h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 32px;
  margin: 0;
}
.thankyou p { font-size: 18px; margin: 0; line-height: 1.45; }

/* ---------- Arabic / RTL ---------- */
.stage[dir="rtl"] { direction: rtl; }
.stage[dir="rtl"] .lang-row { justify-content: flex-end; }
.stage[dir="rtl"] .title,
.stage[dir="rtl"] .field,
.stage[dir="rtl"] .toggle-row { text-align: right; }
.stage[dir="rtl"] .toggle .knob { left: auto; right: 2px; }
.stage[dir="rtl"] .toggle[aria-checked="true"] .knob { transform: translateX(-18px); }

/* Use the Arabic font when in Arabic mode */
.stage[dir="rtl"],
.stage[dir="rtl"] .title,
.stage[dir="rtl"] .thankyou h2,
.stage[dir="rtl"] .field,
.stage[dir="rtl"] .field::placeholder {
  font-family: 'Cairo', 'Montserrat', sans-serif;
}
