/* ════════════════════════════════════════════════════════════
   Daftar auth — White banner card design.
   Loaded only when the LoginScreen / RegisterScreen / RecoveryScreen
   wraps itself in a `.auth-page` element. All rules below are
   scoped under `.auth-page` so they don't leak into the rest of
   the app, which uses different design tokens.
   ════════════════════════════════════════════════════════════ */

.auth-page {
  --auth-bg:           #FAFAFA;
  --auth-paper:        #FFFFFF;
  --auth-cream:        #F5F5F4;
  --auth-sand:         #E7E5E4;
  --auth-line:         #EAE8E6;
  --auth-ink:          #1C1917;
  --auth-muted:        #57534E;
  --auth-soft:         #A8A29E;
  --auth-primary:      #143527;
  --auth-primary-2:    #1F4D38;
  --auth-accent-red:   #DC2626;
  --auth-shadow-lg:    0 8px 24px rgba(15,23,18,0.08), 0 24px 60px rgba(15,23,18,0.10);

  min-height: 100vh;
  min-height: 100dvh;
  padding: 60px 24px;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  background: var(--auth-bg);
  font-family: 'Plus Jakarta Sans', system-ui, sans-serif;
  color: var(--auth-ink);
}
.auth-page[dir="rtl"], .auth-page[dir="rtl"] * {
  font-family: 'Tajawal', 'Plus Jakarta Sans', system-ui, sans-serif;
}
.auth-page::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0;
  height: 280px;
  background: linear-gradient(180deg, #F5F5F4 0%, var(--auth-bg) 100%);
  pointer-events: none;
}

.auth-page .auth-lang {
  /* Fixed so the PWA's safe-area insets keep us inside the viewport
     even when the standalone status bar reserves real space on the right
     (Dynamic Island devices) — absolute against .auth-page was being
     pushed off-screen because page padding stacked with the inset. */
  position: fixed;
  top: max(16px, env(safe-area-inset-top, 0px));
  inset-inline-end: max(16px, env(safe-area-inset-right, 0px));
  z-index: 10;
  padding: 8px 14px;
  background: #fff; border: 1px solid var(--auth-sand);
  border-radius: 8px;
  font-size: 12px; font-weight: 700; color: var(--auth-ink);
  display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap; direction: ltr;
  cursor: pointer; font-family: inherit;
}

.auth-page .auth-card {
  width: min(680px, 100%);
  background: #fff;
  border-radius: 20px;
  box-shadow: var(--auth-shadow-lg);
  overflow: hidden;
  border: 1px solid var(--auth-sand);
  position: relative; z-index: 2;
}

.auth-page .auth-head {
  background: #FFFFFF;
  color: var(--auth-ink);
  padding: 38px 50px 32px;
  position: relative; overflow: hidden;
  border-bottom: 1px solid var(--auth-sand);
}
.auth-page .auth-head::after {
  content: '';
  position: absolute;
  width: 320px; height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(20,53,39,0.04), transparent 70%);
  top: -180px; inset-inline-end: -100px;
}

.auth-page .auth-brand { display: inline-flex; align-items: center; position: relative; z-index: 1; text-decoration: none; cursor: pointer; }
.auth-page .auth-brand .brand-img { height: 46px; width: auto; display: block; }
.auth-page .auth-brand .wm { display: flex; flex-direction: column; }
.auth-page .auth-brand .wm .nm {
  font-size: 17px; font-weight: 800;
  letter-spacing: -0.025em; color: var(--auth-ink);
  line-height: 1;
}
.auth-page .auth-brand .wm .sub {
  font-size: 9.5px; color: var(--auth-muted);
  font-weight: 500; margin-top: 2px; letter-spacing: 0.02em;
}
.auth-page .auth-brand .wm .sub b { color: #2D6A4F; font-weight: 800; }

.auth-page .auth-head h1 {
  font-size: 30px; font-weight: 800;
  letter-spacing: -0.025em;
  margin: 24px 0 8px; color: var(--auth-ink);
  position: relative; z-index: 1;
}
.auth-page[dir="rtl"] .auth-head h1 { letter-spacing: 0; }
.auth-page .auth-head p {
  color: var(--auth-muted);
  font-size: 14.5px; margin: 0;
  position: relative; z-index: 1;
  line-height: 1.5;
}

.auth-page .auth-body { padding: 38px 50px 44px; }
.auth-page .field { margin-bottom: 16px; }

.auth-page .label {
  display: block;
  font-size: 13px; font-weight: 600; color: var(--auth-ink);
  margin-bottom: 6px;
}
.auth-page .label .req { color: var(--auth-accent-red); margin-inline-start: 2px; }

.auth-page .input {
  width: 100%;
  padding: 14px 16px;
  background: var(--auth-bg);
  border: 1px solid var(--auth-sand);
  border-radius: 8px;
  font-family: inherit;
  font-size: 15px; color: var(--auth-ink);
}
.auth-page .input::placeholder { color: var(--auth-soft); }
.auth-page .input:focus {
  outline: none;
  border-color: var(--auth-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(20,53,39,0.10);
}
.auth-page .hint { font-size: 12.5px; color: var(--auth-muted); margin: 6px 0 0; }
.auth-page .err  { font-size: 12.5px; color: var(--auth-accent-red); margin: 8px 0 0; }

.auth-page .phone-row { display: flex; }
.auth-page .phone-row .cc {
  display: flex; align-items: center; gap: 6px;
  padding: 0 14px;
  background: var(--auth-cream);
  border: 1px solid var(--auth-sand);
  border-inline-end: none;
  border-radius: 8px 0 0 8px;
  font-weight: 700; font-size: 14px; color: var(--auth-ink);
  white-space: nowrap;
}
.auth-page[dir="rtl"] .phone-row .cc {
  border-radius: 0 8px 8px 0;
  border-inline-end: 1px solid var(--auth-sand);
  border-inline-start: none;
}
.auth-page .phone-row .cc img { width: 18px; height: auto; border-radius: 2px; }
.auth-page .phone-row .input { border-radius: 0 8px 8px 0; }
.auth-page[dir="rtl"] .phone-row .input { border-radius: 8px 0 0 8px; }

.auth-page .tabs {
  display: inline-flex;
  background: var(--auth-cream);
  border-radius: 999px;
  padding: 4px;
  margin-bottom: 18px;
}
.auth-page .tabs button {
  background: transparent; border: 0;
  padding: 8px 18px;
  border-radius: 999px;
  font-family: inherit; font-weight: 700; font-size: 13px;
  color: var(--auth-muted);
  cursor: pointer;
  transition: background .15s, color .15s;
}
.auth-page .tabs button.is-on {
  background: #fff; color: var(--auth-ink);
  box-shadow: 0 1px 2px rgba(15,23,18,0.04), 0 1px 3px rgba(15,23,18,0.03);
}

.auth-page .btn-cta {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--auth-primary); color: #FAF7F2;
  border: 0; border-radius: 8px;
  font-weight: 800; font-size: 14.5px;
  cursor: pointer;
  transition: background .15s;
  margin-top: 8px;
  font-family: inherit;
}
.auth-page .btn-cta:hover { background: var(--auth-primary-2); }
.auth-page .btn-cta:disabled { opacity: 0.6; cursor: wait; }

.auth-page .alt {
  text-align: center;
  font-size: 13.5px; color: var(--auth-muted);
  margin-top: 20px; padding-top: 18px;
  border-top: 1px solid var(--auth-line);
}
.auth-page .alt a, .auth-page .alt button {
  color: var(--auth-ink); font-weight: 800;
  text-decoration: none;
  margin-inline-start: 6px;
  background: transparent; border: 0;
  font-family: inherit; font-size: inherit;
  cursor: pointer;
  padding: 0;
}

.auth-page .otp-input {
  width: 100%;
  padding: 18px;
  text-align: center;
  font-size: 20px; font-weight: 800;
  letter-spacing: 0.3em;
  background: var(--auth-bg);
  border: 1px solid var(--auth-sand);
  border-radius: 10px;
  color: var(--auth-ink);
  font-family: inherit;
}
/* Hint reads normally; only the typed code gets the wide tracking. */
.auth-page .otp-input::placeholder {
  font-size: 15px; font-weight: 600; letter-spacing: normal;
}
.auth-page .otp-input:focus {
  outline: none;
  border-color: var(--auth-primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(20,53,39,0.10);
}

@media (max-width: 600px) {
  /* Top-align + reserve space above the card so the absolutely-positioned
     language toggle never overlaps a tall form (e.g. sign-up) when the
     card is taller than the viewport and centering pushes it upward. */
  .auth-page { padding: calc(64px + env(safe-area-inset-top, 0px)) 16px 24px; align-items: flex-start; }
  .auth-page .auth-card { border-radius: 16px; }
  .auth-page .auth-head { padding: 28px 24px 22px; }
  .auth-page .auth-head h1 { font-size: 24px; margin-top: 18px; }
  .auth-page .auth-head p { font-size: 13.5px; }
  .auth-page .auth-body { padding: 24px 24px 32px; }
  .auth-page .input { padding: 13px 14px; font-size: 14.5px; }
  .auth-page .btn-cta { padding: 14px; font-size: 14px; }
  .auth-page .auth-lang { top: max(12px, env(safe-area-inset-top, 0px)); inset-inline-end: max(12px, env(safe-area-inset-right, 0px)); padding: 7px 12px; font-size: 11.5px; }
}
