:root {
  color-scheme: dark;
  --auth-bg: #0b132b;
  --auth-neon: #00e5ff;
  --auth-neon-dim: rgba(0, 229, 255, 0.35);
  --auth-green: #00e676;
  --auth-text: #e8eefc;
  --auth-muted: #8b9bb8;
  --auth-bad: #ff6b6b;
  --auth-ok: #5ee69a;
  --auth-wa: #25d366;
  --auth-card: rgba(14, 22, 45, 0.72);
}

* { box-sizing: border-box; }

.auth-page {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: radial-gradient(1200px 700px at 15% -5%, #152448 0%, var(--auth-bg) 55%, #060a14 100%);
  color: var(--auth-text);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 24px 16px max(32px, env(safe-area-inset-bottom, 24px));
  position: relative;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.auth-page::before {
  content: '▲';
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -52%);
  font-size: min(42vw, 280px);
  font-weight: 900;
  color: rgba(0, 229, 255, 0.05);
  pointer-events: none;
  user-select: none;
  line-height: 1;
}

.auth-page::after {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(0, 230, 118, 0.06), transparent 40%),
    radial-gradient(circle at 10% 90%, rgba(0, 229, 255, 0.08), transparent 45%);
  pointer-events: none;
}

.auth-shell {
  width: 100%;
  max-width: 480px;
  position: relative;
  z-index: 1;
  margin: 0 auto;
  padding-bottom: 8px;
}

.auth-brand {
  text-align: center;
  margin-bottom: 18px;
}

.auth-brand .lang-select {
  margin-top: 12px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--auth-text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 0.85rem;
}

.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 1rem;
  font-weight: 800;
  color: var(--auth-neon);
  letter-spacing: 0.04em;
  text-decoration: none;
}

.auth-slogan {
  margin: 10px 0 0;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--auth-text);
}

.auth-slogan em {
  font-style: normal;
  color: var(--auth-green);
}

.auth-card {
  background: var(--auth-card);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--auth-neon-dim);
  border-radius: 20px;
  padding: 28px 24px 24px;
  box-shadow:
    0 0 0 1px rgba(0, 229, 255, 0.08) inset,
    0 24px 60px rgba(0, 0, 0, 0.45);
}

.auth-card h1 {
  margin: 0 0 6px;
  font-size: 1.35rem;
  font-weight: 800;
}

.auth-sub {
  color: var(--auth-muted);
  font-size: 0.88rem;
  margin: 0 0 18px;
  line-height: 1.5;
}

.auth-note {
  color: #ffcc66;
  font-size: 0.85rem;
  margin: 0 0 14px;
  line-height: 1.45;
}

.btn-google {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
  color: var(--auth-text);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
}

.btn-google:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.1);
}

.btn-google svg { flex-shrink: 0; }

.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
  color: var(--auth-muted);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0, 229, 255, 0.25), transparent);
}

.auth-field {
  margin-bottom: 16px;
}

.auth-field label {
  display: block;
  font-size: 0.78rem;
  color: var(--auth-muted);
  margin-bottom: 6px;
  letter-spacing: 0.02em;
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap input {
  width: 100%;
  padding: 11px 2px 10px;
  border: none;
  border-bottom: 2px solid rgba(139, 155, 184, 0.35);
  background: transparent;
  color: var(--auth-text);
  font: inherit;
  font-size: 0.95rem;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.auth-input-wrap input:focus {
  border-bottom-color: var(--auth-neon);
  box-shadow: 0 4px 12px -8px var(--auth-neon);
}

.auth-input-wrap input::placeholder { color: rgba(139, 155, 184, 0.55); }

.auth-pw-wrap input {
  padding-right: 72px;
}

.auth-pw-toggle {
  position: absolute;
  right: 0;
  bottom: 4px;
  border: none;
  background: transparent;
  color: var(--auth-neon);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  padding: 8px 4px;
  line-height: 1;
  opacity: 0.85;
}

.auth-pw-toggle:hover,
.auth-pw-toggle:focus-visible {
  opacity: 1;
  outline: none;
  text-decoration: underline;
}

.auth-field-status {
  font-size: 0.78rem;
  margin: 6px 0 0;
  line-height: 1.35;
  min-height: 1.1em;
}

.auth-field-status.ok { color: var(--auth-ok); }
.auth-field-status.bad { color: var(--auth-bad); }
.auth-field-status.neutral { color: var(--auth-muted); }

.auth-hint-ok { color: var(--auth-ok); }

.auth-phone-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.auth-phone-country {
  flex: 0 0 auto;
  min-width: 108px;
  max-width: 132px;
  padding: 11px 8px 10px;
  border: none;
  border-bottom: 2px solid rgba(139, 155, 184, 0.35);
  background: rgba(11, 19, 43, 0.55);
  color: var(--auth-text);
  font: inherit;
  font-size: 0.9rem;
  outline: none;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.auth-phone-country:focus {
  border-bottom-color: var(--auth-neon);
  box-shadow: 0 4px 12px -8px var(--auth-neon);
}

.auth-phone-national {
  flex: 1 1 auto;
  min-width: 0;
}

.auth-phone-preview {
  color: var(--auth-neon);
  margin-top: 4px;
}

.auth-hint {
  font-size: 0.76rem;
  color: var(--auth-muted);
  margin: 4px 0 0;
  line-height: 1.35;
}

.auth-legal {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(0, 229, 255, 0.12);
  border-radius: 12px;
  padding: 12px;
  margin: 14px 0;
}

.auth-legal label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  cursor: pointer;
  font-size: 0.84rem;
  color: var(--auth-text);
  margin: 0 0 10px;
  line-height: 1.4;
}

.auth-legal label:last-child { margin-bottom: 0; }

.auth-legal input {
  width: 17px;
  height: 17px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--auth-neon);
}

.auth-legal a { color: var(--auth-neon); }

.btn-auth-primary {
  width: 100%;
  margin-top: 6px;
  padding: 14px 16px;
  border: none;
  border-radius: 12px;
  background: linear-gradient(135deg, #00e5ff, #0284c7);
  color: #041018;
  font-weight: 800;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 8px 28px rgba(0, 229, 255, 0.28);
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn-auth-primary:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 32px rgba(0, 229, 255, 0.38);
}

.btn-auth-primary:disabled { opacity: 0.55; cursor: wait; }

.btn-auth-wa {
  background: linear-gradient(135deg, var(--auth-wa), #1ebe57);
  color: #062a12;
  box-shadow: 0 8px 24px rgba(37, 211, 102, 0.25);
}

.auth-err {
  color: var(--auth-bad);
  font-size: 0.86rem;
  margin-top: 12px;
  display: none;
  line-height: 1.4;
}

.auth-ok {
  color: var(--auth-ok);
  font-size: 0.86rem;
  margin-top: 12px;
  display: none;
}

.auth-links {
  margin-top: 18px;
  font-size: 0.85rem;
  color: var(--auth-muted);
  text-align: center;
}

.auth-links a {
  color: var(--auth-neon);
  text-decoration: none;
}

.auth-links a:hover { text-decoration: underline; }

.auth-otp-box {
  display: none;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(0, 229, 255, 0.15);
}

.auth-otp-box.visible { display: block; }

@media (max-width: 520px) {
  .auth-page {
    padding: 12px 12px max(40px, env(safe-area-inset-bottom, 32px));
  }

  .auth-brand {
    margin-bottom: 10px;
  }

  .auth-slogan {
    font-size: 0.95rem;
  }

  .auth-card {
    padding: 20px 16px 18px;
    border-radius: 16px;
  }

  .auth-field {
    margin-bottom: 14px;
  }

  .auth-links {
    margin-top: 16px;
    padding-bottom: 4px;
  }

  .auth-phone-country {
    min-width: 96px;
    max-width: 118px;
    font-size: 0.85rem;
  }
}
