/* Sign-in screens: dark glass, phone-first. */
:root {
  --bg: #0b0d17;
  --card: rgba(255, 255, 255, 0.045);
  --card-border: rgba(255, 255, 255, 0.09);
  --field: rgba(255, 255, 255, 0.06);
  --field-border: rgba(255, 255, 255, 0.12);
  --text: #f1f2f8;
  --text-2: #b4b8cc;
  --text-3: #7d8299;
  --accent: #6d6af7;
  --accent-2: #8b5cf6;
  --good: #34d399;
  --bad: #f87171;
  --warn: #fbbf24;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.5 Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
}
.bg { position: fixed; inset: 0; overflow: hidden; z-index: 0; background: radial-gradient(1200px 700px at 10% -10%, #1a1d3a 0%, transparent 60%), linear-gradient(160deg, #0b0d17, #11142a 55%, #0b0d17); }
.blob { position: absolute; border-radius: 50%; filter: blur(70px); opacity: .45; animation: drift 18s ease-in-out infinite alternate; }
.b1 { width: 420px; height: 420px; background: #4f46e5; top: -120px; left: -100px; opacity: .28; }
.b2 { width: 360px; height: 360px; background: #7c3aed; top: 30%; right: -120px; opacity: .22; animation-duration: 22s; }
.b3 { width: 300px; height: 300px; background: #2563eb; bottom: -120px; left: 30%; opacity: .2; animation-duration: 26s; }
@keyframes drift { to { transform: translate(40px, 30px) scale(1.08); } }
@media (prefers-reduced-motion: reduce) { .blob { animation: none; } * { transition: none !important; } }

.shell {
  position: relative; z-index: 1;
  min-height: 100vh; min-height: 100dvh;
  display: grid; grid-template-columns: 1fr;
  align-items: center; justify-items: center;
  padding: max(20px, env(safe-area-inset-top)) max(16px, env(safe-area-inset-right)) max(20px, env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
  max-width: 1180px; margin: 0 auto; gap: 48px;
}
.brand-panel { display: none; }
.card-wrap { width: 100%; max-width: 440px; display: flex; flex-direction: column; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 20px; letter-spacing: .01em; }
.brand img { width: 40px; height: 40px; object-fit: contain; }
.brand-mobile { justify-content: center; margin-bottom: 4px; }

@media (min-width: 1024px) {
  .shell { grid-template-columns: 1.1fr 0.9fr; justify-items: stretch; }
  .brand-panel { display: flex; flex-direction: column; gap: 18px; padding-right: 24px; }
  .brand-panel h1 { font-size: 44px; line-height: 1.1; margin: 18px 0 0; letter-spacing: -.02em; text-wrap: balance; }
  .brand-panel p { font-size: 18px; color: var(--text-2); margin: 0; max-width: 34ch; }
  .brand-panel .brand img { width: 48px; height: 48px; }
  .brand-points { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 10px; color: var(--text-2); }
  .brand-points li::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--good); margin-right: 10px; vertical-align: 1px; }
  .brand-mobile { display: none; }
  .card-wrap { justify-self: end; }
}

.card {
  background: var(--card);
  border: 1px solid var(--card-border);
  border-radius: 22px;
  padding: 28px 22px;
  backdrop-filter: blur(22px); -webkit-backdrop-filter: blur(22px);
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .6);
  display: flex; flex-direction: column; gap: 18px;
  animation: rise .45s cubic-bezier(.2, .8, .2, 1) both;
}
@media (min-width: 480px) { .card { padding: 34px 32px; } }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

.card h2 { margin: 0; font-size: 25px; letter-spacing: -.01em; text-wrap: balance; }
.sub { margin: -10px 0 0; color: var(--text-2); font-size: 14.5px; }
.sub b { color: var(--text); font-weight: 600; word-break: break-all; }
.credit { text-align: center; color: var(--text-3); font-size: 12.5px; margin: 0; }

form { display: flex; flex-direction: column; gap: 16px; margin: 0; }
.field { display: flex; flex-direction: column; gap: 7px; }
label, .label { font-size: 13.5px; font-weight: 500; color: var(--text-2); }
.input-wrap { position: relative; }
input[type=email], input[type=password], input[type=text], input[type=tel] {
  width: 100%; font: inherit; font-size: 16px; /* 16px stops iOS zoom-on-focus */
  color: var(--text); background: var(--field);
  border: 1px solid var(--field-border); border-radius: 12px;
  padding: 13px 14px; outline: none; transition: border-color .15s, background .15s, box-shadow .15s;
}
input:focus { border-color: rgba(109, 106, 247, .7); background: rgba(255, 255, 255, .08); box-shadow: 0 0 0 3px rgba(109, 106, 247, .18); }
input::placeholder { color: var(--text-3); }
.input-wrap input { padding-right: 48px; }
.eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border: 0; background: none; color: var(--text-3); cursor: pointer; border-radius: 10px; display: grid; place-items: center; }
.eye:hover, .eye:focus-visible { color: var(--text); }
.eye svg { width: 20px; height: 20px; }
.hint { font-size: 12.5px; color: var(--text-3); }

.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.check { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; color: var(--text-2); user-select: none; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); margin: 0; }
a { color: #a5a8ff; text-decoration: none; font-weight: 500; }
a:hover, a:focus-visible { text-decoration: underline; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; min-height: 50px; padding: 12px 18px;
  font: 600 15.5px Inter, sans-serif; border-radius: 13px; border: 1px solid transparent;
  cursor: pointer; transition: transform .12s, box-shadow .2s, background .2s, opacity .2s;
  touch-action: manipulation;
}
.btn:active { transform: scale(.985); }
.btn-primary { color: #fff; background: linear-gradient(135deg, var(--accent), var(--accent-2)); box-shadow: 0 14px 30px -12px rgba(109, 106, 247, .6); }
.btn-primary:hover { box-shadow: 0 18px 38px -12px rgba(109, 106, 247, .75); }
.btn-ghost { color: var(--text); background: rgba(255, 255, 255, .05); border-color: var(--field-border); }
.btn-ghost:hover { background: rgba(255, 255, 255, .09); }
.btn[disabled] { opacity: .55; cursor: not-allowed; transform: none; }
.btn svg { width: 22px; height: 22px; flex-shrink: 0; }
.btn .spinner { width: 18px; height: 18px; border: 2px solid rgba(255, 255, 255, .35); border-top-color: #fff; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
:focus-visible { outline: 2px solid #a5a8ff; outline-offset: 2px; }

.divider { display: flex; align-items: center; gap: 12px; color: var(--text-3); font-size: 12.5px; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--card-border); }

.alert { border-radius: 12px; padding: 11px 14px; font-size: 14px; line-height: 1.45; }
.alert-error { background: rgba(248, 113, 113, .12); color: #fecaca; border: 1px solid rgba(248, 113, 113, .3); }
.alert-success { background: rgba(52, 211, 153, .12); color: #bbf7d0; border: 1px solid rgba(52, 211, 153, .3); }
.alert-info { background: rgba(109, 106, 247, .12); color: #dcdcff; border: 1px solid rgba(109, 106, 247, .3); }
.center { text-align: center; }
.muted { color: var(--text-3); font-size: 13.5px; }

/* Welcome-back (remembered device) */
.who { display: flex; align-items: center; gap: 14px; }
.avatar { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 18px; background: linear-gradient(135deg, var(--accent), var(--accent-2)); flex-shrink: 0; }
.who-name { font-weight: 700; font-size: 18px; }
.who-mail { color: var(--text-2); font-size: 13.5px; word-break: break-all; }

/* PIN pad */
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 4px 0; }
.pin-dots span { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--text-3); transition: background .15s, border-color .15s, transform .15s; }
.pin-dots span.on { background: var(--text); border-color: var(--text); transform: scale(1.05); }
.pin-dots.shake { animation: shake .4s; }
@keyframes shake { 20%, 60% { transform: translateX(-8px); } 40%, 80% { transform: translateX(8px); } }
.pinpad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; max-width: 300px; margin: 0 auto; width: 100%; }
.pinpad button {
  aspect-ratio: 1.35; border-radius: 16px; border: 1px solid var(--field-border); background: rgba(255, 255, 255, .05);
  color: var(--text); font: 600 22px Inter, sans-serif; cursor: pointer; touch-action: manipulation; transition: background .12s, transform .08s;
}
.pinpad button:active { background: rgba(255, 255, 255, .14); transform: scale(.96); }
.pinpad .ghost { background: none; border-color: transparent; font-size: 14px; color: var(--text-2); }
.pin-hidden { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }

/* OTP */
.otp { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.otp input { text-align: center; font: 700 22px/1 "SFMono-Regular", Consolas, monospace; padding: 14px 0; }

.steps { display: flex; gap: 6px; }
.steps span { flex: 1; height: 4px; border-radius: 4px; background: var(--card-border); }
.steps span.on { background: linear-gradient(90deg, var(--accent), var(--accent-2)); }

.options { display: flex; flex-direction: column; gap: 10px; }
.option { display: flex; align-items: center; gap: 14px; padding: 14px; border-radius: 14px; border: 1px solid var(--field-border); background: rgba(255, 255, 255, .04); text-align: left; color: var(--text); font: inherit; cursor: pointer; width: 100%; }
.option:hover { background: rgba(255, 255, 255, .08); }
.option .ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(109, 106, 247, .18); color: #c7c8ff; flex-shrink: 0; }
.option .ic svg { width: 24px; height: 24px; }
.option b { display: block; font-size: 15px; }
.option small { color: var(--text-2); font-size: 13px; }
.option.done { border-color: rgba(52, 211, 153, .45); }
.option.done .ic { background: rgba(52, 211, 153, .18); color: var(--good); }
.strength { height: 4px; border-radius: 4px; background: var(--card-border); overflow: hidden; }
.strength i { display: block; height: 100%; width: 0; background: var(--bad); transition: width .2s, background .2s; }
[hidden] { display: none !important; }

/* Strength label + Caps Lock notice */
.strength-label { font-size: 12.5px; font-weight: 600; min-height: 1.2em; margin-top: -2px; }
.capslock { font-size: 12.5px; color: var(--warn); display: flex; align-items: center; gap: 6px; margin-top: -4px; }
.capslock::before { content: "⇪"; font-size: 14px; }
a.btn { text-decoration: none; }
