* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --font-sans: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --primary: #0c3ae6;
  --primary-glow: rgba(12, 58, 230, 0.45);
  --bg: #e8ecf4;
  --bg-elevated: #f0f3fa;
  --surface: #ffffff;
  --text: #0b1120;
  --muted: #64748b;
  --border: 1px solid rgba(15, 23, 42, 0.08);
  --radius: 16px;
  --radius-lg: 24px;
  --shadow-xs: 0 1px 2px rgba(11, 17, 32, 0.04);
  --shadow-sm: 0 4px 20px rgba(11, 17, 32, 0.06);
  --shadow-md: 0 20px 50px rgba(15, 23, 42, 0.12);
  --success: #059669;
  --danger: #dc2626;
}

html {
  -webkit-font-smoothing: antialiased;
}

body {
  font-family: var(--font-sans);
  letter-spacing: -0.011em;
  min-height: 100vh;
  min-height: 100dvh;
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(92, 135, 255, 0.18), transparent 50%),
    radial-gradient(900px 500px at 95% 20%, rgba(12, 58, 230, 0.1), transparent 45%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-elevated) 50%, #e4e9f2 100%);
  color: var(--text);
  padding: 28px 18px;
  padding-bottom: max(28px, env(safe-area-inset-bottom));
  position: relative;
}

.login-wrapper {
  display: flex;
  max-width: 1120px;
  width: 100%;
  gap: 32px;
  margin: 0 auto;
  align-items: stretch;
}

.login-container {
  flex: 1;
  max-width: 420px;
  margin: 0 auto;
  width: 100%;
  background: var(--surface);
  border: var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xs), var(--shadow-md);
  padding: 0;
  overflow: hidden;
  position: relative;
}

.login-container::before {
  content: '';
  display: block;
  height: 4px;
  background: linear-gradient(90deg, #60a5fa, var(--primary), #1d4ed8, #6366f1);
  background-size: 200% 100%;
  animation: auth-shimmer 8s ease infinite;
}

@keyframes auth-shimmer {
  0%, 100% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
}

.login-container-inner {
  padding: 28px 26px 30px;
}

.info-panel {
  flex: 1;
  max-width: 420px;
  border-radius: var(--radius-lg);
  background: linear-gradient(165deg, #070d18 0%, #0f172a 42%, #111827 100%);
  border: 1px solid rgba(255, 255, 255, 0.07);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
  color: #f8fafc;
  padding: 34px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---- Brand row ---- */
.logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 26px;
}

.logo-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(145deg, #93c5fd 0%, #3b82f6 40%, #1d4ed8 100%);
  box-shadow:
    0 4px 16px rgba(12, 58, 230, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.logo-icon svg {
  width: 28px;
  height: 28px;
  color: #fff;
}

.logo-text {
  font-size: 21px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  line-height: 1.15;
}

.logo-subtitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  margin-top: 2px;
}

.form-title {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
  letter-spacing: -0.03em;
}

.form-lead {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 24px;
}

/* ---- Inputs ---- */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  margin-bottom: 8px;
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.form-label-icon {
  display: none;
}

.input-shell {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 4px 0 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  background: linear-gradient(180deg, #fafbfd 0%, #f4f6f9 100%);
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.input-shell:focus-within {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(12, 58, 230, 0.1);
}

.input-shell-icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  color: #94a3b8;
  transition: color 0.2s;
}

.input-shell:focus-within .input-shell-icon {
  color: var(--primary);
}

.form-input {
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 14px 12px 14px 0;
  border: none;
  border-radius: 0;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  color: var(--text);
  background: transparent;
}

.form-input::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.form-input:focus {
  outline: none;
}

.form-input.error {
  animation: shake 0.35s;
}

.input-shell:has(.form-input.error) {
  border-color: var(--danger);
  background: #fffafb;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-5px); }
  60% { transform: translateX(5px); }
}

.form-input.success {
  /* shell handled via optional class on parent */
}

.input-shell.input-shell--ok {
  border-color: rgba(5, 150, 105, 0.45);
  background: #f0fdf9;
}

.error-message {
  color: var(--danger);
  font-size: 12px;
  margin-top: 8px;
  display: none;
  font-weight: 600;
}

.form-input.error ~ .error-message {
  display: block;
}

.form-group:has(.form-input.error) .error-message {
  display: block;
}

.password-toggle {
  position: relative;
  display: flex;
  align-items: stretch;
}

.password-toggle .input-shell {
  flex: 1;
  padding-right: 0;
}

.password-toggle-btn {
  align-self: stretch;
  margin: 6px 6px 6px 0;
  width: 44px;
  border: none;
  cursor: pointer;
  background: rgba(241, 245, 249, 0.9);
  border-radius: 10px;
  color: var(--muted);
  display: grid;
  place-items: center;
  transition: background 0.15s, color 0.15s;
}

.password-toggle-btn:hover {
  background: #e2e8f0;
  color: var(--text);
}

.password-toggle-btn svg {
  width: 20px;
  height: 20px;
}

.checkbox-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 18px 0 22px;
  flex-wrap: wrap;
  gap: 12px;
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  gap: 10px;
}

.checkbox {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
  border-radius: 4px;
}

.checkbox-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.forgot-link {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  padding: 4px 0;
}

.forgot-link:hover {
  text-decoration: underline;
}

/* ---- Buttons ---- */
.btn {
  width: 100%;
  padding: 15px 20px;
  border: none;
  border-radius: 14px;
  font-size: 15px;
  font-weight: 800;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.2s, filter 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
}

.btn-primary {
  background: linear-gradient(135deg, #5c87ff 0%, #0c3ae6 48%, #0526b5 100%);
  color: #fff;
  box-shadow:
    0 4px 16px rgba(12, 58, 230, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.12), transparent);
  transform: translateX(-100%);
  transition: transform 0.5s;
}

.btn-primary:hover::after {
  transform: translateX(100%);
}

.btn-primary:hover {
  box-shadow: 0 8px 28px rgba(12, 58, 230, 0.42);
  filter: brightness(1.03);
}

.btn-primary:active {
  transform: scale(0.992);
}

.btn-primary:disabled {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  cursor: not-allowed;
  box-shadow: none;
  filter: none;
}

.btn-primary:disabled::after {
  display: none;
}

.btn svg {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* ---- Alerts ---- */
.alert {
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 18px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
  border: 1px solid transparent;
}

.alert-error {
  background: linear-gradient(135deg, #fef2f2 0%, #fff1f2 100%);
  color: #991b1b;
  border-color: #fecaca;
}

.alert-success {
  background: linear-gradient(135deg, #f0fdf4 0%, #ecfdf5 100%);
  color: #166534;
  border-color: #bbf7d0;
}

.alert-info {
  background: linear-gradient(135deg, #eff6ff 0%, #f0f9ff 100%);
  color: #1e3a8a;
  border-color: #bfdbfe;
  margin-bottom: 18px;
}

/* ---- SMS / 2FA ---- */
.verify-head {
  margin-bottom: 20px;
}

.verify-head-title {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.verify-head-sub {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.5;
}

.sms-card {
  display: flex;
  gap: 16px;
  padding: 18px 18px 18px 16px;
  border-radius: 16px;
  background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);
  margin-bottom: 24px;
  position: relative;
  overflow: hidden;
}

.sms-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(180deg, #22c55e, var(--primary));
  border-radius: 4px 0 0 4px;
}

.sms-card-icon-wrap {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, #dbeafe, #eff6ff);
  border: 1px solid #bfdbfe;
  display: grid;
  place-items: center;
  color: var(--primary);
}

.sms-card-icon-wrap svg {
  width: 24px;
  height: 24px;
}

.sms-card-body {
  flex: 1;
  min-width: 0;
  padding-top: 2px;
}

.sms-card-kicker {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--primary);
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sms-pulse {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.5);
  animation: sms-pulse 2s ease infinite;
}

@keyframes sms-pulse {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.45); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.sms-card-phone {
  font-size: 17px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
  word-break: break-all;
  margin-bottom: 8px;
}

.sms-card-hint {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  font-weight: 500;
}

.phone-strong {
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
}

/* OTP cells */
.otp-section-label {
  font-size: 11px;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
  text-align: center;
}

.otp-grid {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 8px;
}

.otp-cell {
  width: 1fr;
  flex: 1;
  max-width: 48px;
  height: 52px;
  text-align: center;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-family: inherit;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background: linear-gradient(180deg, #fff 0%, #f8fafc 100%);
  color: var(--text);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}

.otp-cell:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(12, 58, 230, 0.12);
  transform: translateY(-1px);
  background: #fff;
}

.otp-cell.filled {
  border-color: #cbd5e1;
  background: #fff;
}

.back-2fa-wrap {
  text-align: center;
  margin-top: 22px;
}

.back-2fa-wrap a {
  color: var(--muted);
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  transition: color 0.15s, background 0.15s;
}

.back-2fa-wrap a:hover {
  color: var(--primary);
  background: #f1f5f9;
}

.back-2fa-wrap a svg {
  width: 16px;
  height: 16px;
}

/* ---- Info panel ---- */
.info-title {
  font-size: 26px;
  font-weight: 800;
  margin-bottom: 10px;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.info-subtitle {
  font-size: 14px;
  color: rgba(248, 250, 252, 0.72);
  margin-bottom: 28px;
  line-height: 1.55;
}

.feature-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.feature-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px 16px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: background 0.2s, border-color 0.2s;
}

.feature-item:hover {
  background: rgba(255, 255, 255, 0.09);
  border-color: rgba(255, 255, 255, 0.12);
}

.feature-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  background: linear-gradient(145deg, rgba(59, 130, 246, 0.35), rgba(12, 58, 230, 0.25));
}

.feature-content h3 {
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 4px;
  color: #fff;
}

.feature-content p {
  font-size: 12px;
  line-height: 1.5;
  color: rgba(248, 250, 252, 0.65);
}

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 28px;
}

.stat-item {
  text-align: center;
  padding: 14px 8px;
  background: rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.stat-value {
  font-size: 20px;
  font-weight: 800;
  margin-bottom: 2px;
  color: #fff;
}

.stat-label {
  font-size: 11px;
  font-weight: 600;
  color: rgba(248, 250, 252, 0.55);
}

@media (max-width: 900px) {
  .login-wrapper {
    flex-direction: column;
    align-items: stretch;
  }

  .info-panel {
    max-width: 420px;
    margin: 0 auto;
    width: 100%;
  }
}

@media (max-width: 480px) {
  body {
    padding: 16px 12px;
  }

  .login-container-inner {
    padding: 22px 18px 24px;
  }

  .logo {
    margin-bottom: 20px;
  }

  .form-title {
    font-size: 20px;
  }

  .checkbox-group {
    flex-direction: column;
    align-items: flex-start;
  }

  .stats {
    grid-template-columns: 1fr;
  }

  .otp-grid {
    gap: 6px;
  }

  .otp-cell {
    max-width: 44px;
    height: 48px;
    font-size: 18px;
    border-radius: 10px;
  }

  .sms-card {
    flex-direction: column;
    text-align: center;
    padding: 20px 16px;
  }

  .sms-card::before {
    width: 100%;
    height: 4px;
    top: 0;
    left: 0;
    bottom: auto;
    border-radius: 4px 4px 0 0;
  }

  .sms-card-icon-wrap {
    margin: 0 auto;
  }

  .sms-card-kicker {
    justify-content: center;
  }
}
