:root {
  --auth-bg: #07100c;
  --auth-bg-2: #0d1814;
  --auth-surface: #16221d;
  --auth-surface-2: #1d2a24;
  --auth-border: rgba(255, 255, 255, 0.12);
  --auth-border-strong: rgba(255, 255, 255, 0.22);
  --auth-text: #ffffff;
  --auth-text-2: #e6ece9;
  --auth-muted: #9fb0a8;
  --auth-accent: #d4a55e;
  --auth-accent-hover: #e6b975;
  --auth-error: #fca5a5;
  --auth-success: #86efac;
}

* { box-sizing: border-box; }

body.auth-page {
  margin: 0;
  min-height: 100vh;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  background:
    radial-gradient(circle at 15% 8%, rgba(212, 165, 94, 0.10) 0%, transparent 55%),
    radial-gradient(circle at 85% 90%, rgba(74, 222, 128, 0.06) 0%, transparent 55%),
    linear-gradient(180deg, var(--auth-bg-2) 0%, var(--auth-bg) 100%);
  color: var(--auth-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 20px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html[dir="rtl"] body.auth-page { text-align: right; }

.auth-shell {
  width: 100%;
  max-width: 480px;
  background: var(--auth-surface);
  border: 1px solid var(--auth-border);
  border-radius: 22px;
  padding: 36px 34px 32px;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55), 0 1px 0 rgba(255,255,255,0.04) inset;
  position: relative;
}

.auth-shell.wide { max-width: 580px; }

.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.auth-shell .brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-shell .brand .logo {
  width: 42px; height: 42px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #243530, #324942);
  font-size: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.4);
}

.auth-shell .brand .product {
  font-weight: 600;
  letter-spacing: 0.01em;
  font-size: 1.02rem;
  color: var(--auth-text);
}

.lang-switcher {
  display: inline-flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0,0,0,0.35);
  border: 1px solid var(--auth-border);
}

.lang-chip {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--auth-muted);
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background .15s ease, color .15s ease;
}
.lang-chip:hover { color: var(--auth-text); }
.lang-chip.is-active { background: var(--auth-accent); color: #1a1a1a; }

.auth-shell h1 {
  font-size: 1.65rem;
  margin: 0 0 10px 0;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--auth-text);
}

.auth-shell .subtitle {
  color: var(--auth-text-2);
  font-size: 0.96rem;
  margin: 0 0 26px 0;
  line-height: 1.55;
}

.auth-shell label {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--auth-text-2);
  margin-bottom: 8px;
}

.auth-shell input[type="email"],
.auth-shell input[type="password"],
.auth-shell input[type="text"],
.auth-shell select {
  width: 100%;
  padding: 13px 14px;
  border-radius: 12px;
  border: 1px solid var(--auth-border);
  background: rgba(0,0,0,0.30);
  color: var(--auth-text);
  font-size: 0.98rem;
  font-family: inherit;
  margin-bottom: 18px;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}

.auth-shell input:focus,
.auth-shell select:focus {
  outline: none;
  border-color: var(--auth-accent);
  background: rgba(0,0,0,0.45);
  box-shadow: 0 0 0 3px rgba(212, 165, 94, 0.18);
}

.auth-shell input::placeholder {
  color: rgba(255, 255, 255, 0.32);
}

.auth-shell .hint {
  font-size: 0.82rem;
  color: var(--auth-muted);
  margin: -12px 0 18px 0;
  line-height: 1.5;
}

.auth-shell .primary-btn {
  width: 100%;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(180deg, var(--auth-accent-hover) 0%, var(--auth-accent) 100%);
  color: #1a1a1a;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: filter .15s ease, transform .1s ease, box-shadow .15s ease;
  box-shadow: 0 4px 14px rgba(212, 165, 94, 0.28);
}

.auth-shell .primary-btn:hover { filter: brightness(1.06); box-shadow: 0 6px 18px rgba(212, 165, 94, 0.38); }
.auth-shell .primary-btn:active { transform: translateY(1px); }
.auth-shell .primary-btn:disabled { opacity: 0.55; cursor: not-allowed; box-shadow: none; filter: none; }

.auth-shell .ghost-btn {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--auth-border-strong);
  border-radius: 12px;
  background: transparent;
  color: var(--auth-text);
  font-family: inherit;
  font-size: 0.92rem;
  cursor: pointer;
  margin-top: 10px;
  transition: background .15s ease, border-color .15s ease;
}
.auth-shell .ghost-btn:hover { background: rgba(255,255,255,0.04); border-color: var(--auth-accent); }
.auth-shell .ghost-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.auth-shell .feedback {
  margin-top: 16px;
  font-size: 0.9rem;
  min-height: 1.2em;
  line-height: 1.45;
}
.auth-shell .feedback.error { color: var(--auth-error); }
.auth-shell .feedback.success { color: var(--auth-success); }

.auth-shell .alt {
  margin-top: 22px;
  text-align: center;
  font-size: 0.92rem;
  color: var(--auth-text-2);
}
.auth-shell .alt a { color: var(--auth-accent); text-decoration: none; font-weight: 500; }
.auth-shell .alt a:hover { text-decoration: underline; }

.auth-shell .forgot {
  display: block;
  text-align: right;
  margin-top: -8px;
  margin-bottom: 18px;
  font-size: 0.82rem;
}
.auth-shell .forgot a { color: var(--auth-accent); text-decoration: none; }
.auth-shell .forgot a:hover { text-decoration: underline; }

.auth-shell .divider {
  display: flex; align-items: center; gap: 14px;
  margin: 20px 0;
  color: var(--auth-muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.12em; font-weight: 600;
}
.auth-shell .divider::before,
.auth-shell .divider::after {
  content: ""; flex: 1; height: 1px; background: var(--auth-border);
}

.auth-shell .google-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid var(--auth-border-strong);
  background: #ffffff;
  color: #1f1f1f;
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s ease, transform .1s ease;
}
.auth-shell .google-btn:hover { background: #f3f4f6; }
.auth-shell .google-btn:active { transform: translateY(1px); }
.auth-shell .google-btn svg { width: 20px; height: 20px; }
.auth-shell .google-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.auth-shell .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

@media (max-width: 640px) {
  body.auth-page { padding: 20px 14px; align-items: flex-start; padding-top: 28px; }
  .auth-shell { padding: 28px 22px; border-radius: 18px; }
  .auth-shell h1 { font-size: 1.4rem; }
  .auth-shell .subtitle { font-size: 0.92rem; margin-bottom: 22px; }
  .auth-shell .row { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 420px) {
  body.auth-page { padding: 16px 12px; padding-top: 22px; }
  .auth-shell { padding: 22px 18px; border-radius: 16px; }
  .auth-shell h1 { font-size: 1.25rem; }
  .auth-shell .subtitle { font-size: 0.88rem; margin-bottom: 18px; }
  .auth-shell .brand .logo { width: 36px; height: 36px; font-size: 17px; }
  .auth-shell .brand .product { font-size: 0.95rem; }
  .lang-chip { padding: 4px 8px; font-size: 0.68rem; }
  .auth-shell input[type="email"],
  .auth-shell input[type="password"],
  .auth-shell input[type="text"],
  .auth-shell select {
    padding: 12px 13px;
    font-size: 16px; /* prevents iOS Safari zoom on focus */
    margin-bottom: 14px;
  }
  .auth-shell .primary-btn { padding: 13px 14px; font-size: 0.96rem; }
  .auth-shell .google-btn { padding: 11px 14px; font-size: 0.92rem; }
  .auth-shell .divider { margin: 16px 0; font-size: 0.7rem; }
  .auth-shell .alt { font-size: 0.88rem; }
}

.steps {
  display: flex; gap: 10px; margin-bottom: 26px;
}
.steps .step {
  flex: 1; height: 5px; border-radius: 5px;
  background: rgba(255,255,255,0.10);
  transition: background .2s ease;
}
.steps .step.active { background: var(--auth-accent); box-shadow: 0 0 12px rgba(212,165,94,0.5); }
.steps .step.done { background: var(--auth-success); }

.summary {
  background: rgba(0,0,0,0.30);
  border: 1px solid var(--auth-border);
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 22px;
  font-size: 0.95rem;
}
.summary dt { color: var(--auth-muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.08em; font-weight: 600; margin-top: 8px; }
.summary dt:first-child { margin-top: 0; }
.summary dd { margin: 4px 0 0 0; color: var(--auth-text); font-weight: 500; }

.price-card {
  border: 1px solid var(--auth-border-strong);
  background: linear-gradient(180deg, var(--auth-surface-2) 0%, var(--auth-surface) 100%);
  border-radius: 16px;
  padding: 22px;
  margin-bottom: 22px;
}
.price-card .amount { font-size: 1.9rem; font-weight: 700; color: var(--auth-text); letter-spacing: -0.01em; }
.price-card .amount small { font-size: 0.92rem; color: var(--auth-muted); font-weight: 400; margin-left: 4px; }
.price-card ul { padding-inline-start: 22px; margin: 14px 0 0 0; color: var(--auth-text-2); font-size: 0.94rem; }
.price-card ul li { margin-bottom: 6px; line-height: 1.5; }
.price-card ul li::marker { color: var(--auth-accent); }

/* Al Fahm Pro UI Pass — auth/onboarding/login */
:root {
  --auth-bg: #080f0b;
  --auth-bg-2: #0c1510;
  --auth-surface: rgba(17, 29, 23, 0.86);
  --auth-surface-2: rgba(23, 39, 31, 0.78);
  --auth-border: rgba(244, 238, 226, 0.10);
  --auth-border-strong: rgba(244, 238, 226, 0.18);
  --auth-text: #f4eee2;
  --auth-text-2: #d4ccbd;
  --auth-muted: #9f978a;
  --auth-accent: #c8a45c;
  --auth-accent-hover: #d8b772;
}

body.auth-page {
  background:
    radial-gradient(circle at 20% -10%, rgba(200, 164, 92, 0.11), transparent 34%),
    radial-gradient(circle at 88% 100%, rgba(143, 181, 134, 0.07), transparent 38%),
    linear-gradient(180deg, #0b1510 0%, #070c09 100%);
  padding: clamp(18px, 4vw, 34px);
}

.auth-shell {
  max-width: 440px;
  padding: 26px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.03), rgba(255,255,255,0.008)),
    var(--auth-surface);
  border-color: var(--auth-border);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.42);
}

.auth-shell.wide {
  max-width: 560px;
}

.auth-topbar {
  margin-bottom: 20px;
}

.auth-shell .brand .logo {
  width: 104px;
  height: 62px;
  border-radius: 0;
  font-size: 0;
  background:
    url("/images/al_fahm_logo_transparent_cropped.png") center / contain no-repeat;
  border: 0;
  box-shadow: none;
  flex: none;
}

.auth-shell .brand .logo::before {
  content: none;
}

.auth-shell .brand .product {
  font-size: 0.94rem;
  font-weight: 700;
}

.auth-shell h1 {
  font-size: 1.42rem;
  line-height: 1.15;
  letter-spacing: -0.025em;
  margin-bottom: 8px;
}

.auth-shell .subtitle {
  font-size: 0.9rem;
  color: var(--auth-muted);
  margin-bottom: 20px;
}

.auth-shell label {
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  color: var(--auth-muted);
  margin-bottom: 6px;
}

.auth-shell input[type="email"],
.auth-shell input[type="password"],
.auth-shell input[type="text"],
.auth-shell select {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 10px;
  background: rgba(4, 10, 7, 0.58);
  font-size: 0.9rem;
  margin-bottom: 14px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.025);
}

.auth-shell input:focus,
.auth-shell select:focus {
  background: rgba(4, 10, 7, 0.72);
  box-shadow: 0 0 0 3px rgba(200, 164, 92, 0.14);
}

.auth-shell .primary-btn,
.auth-shell .google-btn,
.auth-shell .ghost-btn {
  min-height: 42px;
  padding: 0 14px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 650;
}

.auth-shell .primary-btn {
  background: linear-gradient(180deg, var(--auth-accent-hover), var(--auth-accent));
  box-shadow: 0 8px 20px rgba(200, 164, 92, 0.16);
}

.auth-shell .google-btn {
  background: rgba(255,255,255,0.96);
}

.auth-shell .ghost-btn {
  border-color: var(--auth-border);
  background: rgba(255,255,255,0.025);
}

.lang-switcher {
  padding: 3px;
  background: rgba(4, 10, 7, 0.58);
}

.lang-chip {
  min-height: 28px;
  padding: 0 9px;
  font-size: 0.68rem;
}

.divider {
  margin: 16px 0;
}

.auth-shell .row {
  gap: 10px;
}

.summary,
.price-card {
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 16px;
  background: rgba(4, 10, 7, 0.42);
}

.price-card .amount {
  font-size: 1.55rem;
}

.steps {
  margin-bottom: 20px;
  gap: 8px;
}

@media (max-width: 640px) {
  .auth-shell {
    max-width: 100%;
    padding: 22px 18px;
  }

  .auth-shell input[type="email"],
  .auth-shell input[type="password"],
  .auth-shell input[type="text"],
  .auth-shell select,
  .auth-shell .primary-btn,
  .auth-shell .google-btn,
  .auth-shell .ghost-btn {
    min-height: 44px;
    font-size: 16px;
  }
}

/* Mobile density pass — keep auth pages premium, not oversized. */
@media (max-width: 640px) {
  body.auth-page {
    align-items: flex-start;
    justify-content: center;
    padding: max(14px, env(safe-area-inset-top)) 12px max(18px, env(safe-area-inset-bottom));
    line-height: 1.45;
  }

  .auth-shell,
  .auth-shell.wide {
    max-width: 370px;
    width: 100%;
    padding: 18px 16px 16px;
    border-radius: 16px;
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  }

  .auth-topbar {
    gap: 10px;
    margin-bottom: 14px;
  }

  .auth-shell .brand {
    gap: 8px;
    min-width: 0;
  }

  .auth-shell .brand .logo {
    width: 72px;
    height: 44px;
  }

  .auth-shell .brand .product {
    font-size: 0.86rem;
    line-height: 1.15;
  }

  .lang-switcher {
    gap: 2px;
    padding: 2px;
  }

  .lang-chip {
    min-height: 28px;
    padding: 0 8px;
    font-size: 0.66rem;
  }

  .auth-shell h1 {
    font-size: clamp(1.18rem, 5.2vw, 1.34rem);
    line-height: 1.12;
    margin-bottom: 6px;
  }

  .auth-shell .subtitle {
    font-size: 0.86rem;
    line-height: 1.42;
    margin-bottom: 16px;
  }

  .auth-shell label {
    font-size: 0.66rem;
    margin-bottom: 5px;
  }

  .auth-shell input[type="email"],
  .auth-shell input[type="password"],
  .auth-shell input[type="text"],
  .auth-shell select {
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    font-size: 16px;
    margin-bottom: 11px;
  }

  .auth-shell .hint {
    margin: -6px 0 12px;
    font-size: 0.76rem;
    line-height: 1.35;
  }

  .auth-shell .primary-btn,
  .auth-shell .google-btn,
  .auth-shell .ghost-btn {
    min-height: 44px;
    padding: 0 13px;
    border-radius: 10px;
    font-size: 0.9rem;
  }

  .auth-shell .google-btn {
    gap: 9px;
  }

  .auth-shell .google-btn svg {
    width: 17px;
    height: 17px;
  }

  .auth-shell .divider {
    margin: 13px 0;
    gap: 10px;
    font-size: 0.66rem;
  }

  .auth-shell .feedback {
    margin-top: 12px;
    font-size: 0.82rem;
  }

  .auth-shell .alt {
    margin-top: 16px;
    font-size: 0.84rem;
  }

  .auth-shell .forgot {
    margin-top: -4px;
    margin-bottom: 12px;
    font-size: 0.78rem;
  }

  .steps {
    gap: 7px;
    margin-bottom: 16px;
  }

  .steps .step {
    height: 4px;
  }

  .summary,
  .price-card {
    padding: 12px 13px;
    margin-bottom: 13px;
    border-radius: 12px;
  }

  .summary {
    font-size: 0.84rem;
  }

  .price-card .amount {
    font-size: 1.38rem;
  }

  .price-card ul {
    margin-top: 10px;
    font-size: 0.84rem;
    line-height: 1.42;
  }
}

@media (max-width: 380px) {
  .auth-shell {
    padding: 16px 14px 14px;
  }

  .auth-shell .brand .logo {
    width: 62px;
    height: 38px;
  }

  .auth-shell .brand .product {
    font-size: 0.8rem;
  }

  .lang-chip {
    padding: 0 7px;
  }
}
