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

:root {
  --navy: #0B1120;
  --navy-light: #162032;
  --royal: #3B82F6;
  --royal-dark: #2563EB;
  --indigo: #6366F1;
  --teal: #14B8A6;
  --cyan: #06B6D4;
  --emerald: #10B981;
  --violet: #8B5CF6;
  --rose: #F43F5E;
  --amber: #F59E0B;
  --white: #FFFFFF;
  --bg: #F8FAFC;
  --surface: #FFFFFF;
  --border: #E2E8F0;
  --border-light: #F1F5F9;
  --text: #0F172A;
  --text-secondary: #64748B;
  --text-muted: #94A3B8;
  --gray-50: #F8FAFC;
  --gray-100: #F1F5F9;
  --gray-200: #E2E8F0;
  --gray-300: #CBD5E1;
  --gray-400: #94A3B8;
  --gray-500: #64748B;
  --gray-600: #475569;
  --gray-700: #334155;
  --gray-800: #1E293B;
  --gray-900: #0F172A;
  --red-50: #FEF2F2;
  --red-100: #FEE2E2;
  --red-500: #EF4444;
  --green-50: #ECFDF5;
  --green-500: #10B981;
  --blue-50: #EFF6FF;
  --blue-500: #3B82F6;
  --shadow-xs: 0 1px 2px rgba(11,17,32,0.04);
  --shadow-sm: 0 1px 3px rgba(11,17,32,0.08), 0 1px 2px rgba(11,17,32,0.06);
  --shadow-md: 0 4px 6px -1px rgba(11,17,32,0.08), 0 2px 4px -2px rgba(11,17,32,0.06);
  --shadow-lg: 0 10px 15px -3px rgba(11,17,32,0.08), 0 4px 6px -4px rgba(11,17,32,0.04);
  --shadow-xl: 0 20px 25px -5px rgba(11,17,32,0.08), 0 8px 10px -6px rgba(11,17,32,0.04);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-xs: 6px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Inter', sans-serif;
}

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* === LAYOUT === */
.login-page {
  display: flex;
  min-height: 100vh;
}

/* === LEFT: BRAND PANEL (55%) === */
.login-brand {
  flex: 0 0 55%;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.brand-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(160deg, #0B1120 0%, #162032 40%, #0F1B3D 70%, #0B1120 100%);
  z-index: 0;
}

.brand-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    radial-gradient(ellipse at 15% 30%, rgba(59,130,246,0.12) 0%, transparent 55%),
    radial-gradient(ellipse at 85% 20%, rgba(20,184,166,0.08) 0%, transparent 50%),
    radial-gradient(ellipse at 50% 85%, rgba(99,102,241,0.06) 0%, transparent 45%);
  pointer-events: none;
}

.brand-content {
  position: relative;
  z-index: 3;
  max-width: 520px;
  width: 100%;
  padding: 48px;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 100px;
  background: rgba(59,130,246,0.12);
  border: 1px solid rgba(59,130,246,0.2);
  color: #93C5FD;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 28px;
  text-transform: uppercase;
}

.brand-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #22D3EE;
  box-shadow: 0 0 8px rgba(34,211,238,0.5);
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.brand-headline {
  font-family: var(--font-display);
  font-size: 44px;
  font-weight: 800;
  line-height: 1.15;
  color: var(--white);
  margin-bottom: 36px;
  letter-spacing: -0.5px;
}

.brand-headline .brand-highlight {
  background: linear-gradient(135deg, #60A5FA, #2DD4BF);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.brand-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 40px;
}

.brand-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  color: rgba(255,255,255,0.75);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.25s ease;
}

.brand-feature:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.12);
  transform: translateY(-1px);
}

.bf-icon {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  color: #60A5FA;
}

.brand-testimonial {
  display: flex;
  align-items: center;
  gap: 16px;
}

.bt-avatars {
  display: flex;
  align-items: center;
}

.bt-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  border: 2px solid rgba(11,17,32,0.8);
  position: relative;
}

.bt-text {
  font-size: 14px;
  color: rgba(255,255,255,0.65);
}

.bt-text strong {
  color: rgba(255,255,255,0.95);
  font-weight: 700;
}

/* === Floating Shapes === */
.brand-shapes {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}

.shape {
  position: absolute;
  border-radius: 50%;
  opacity: 0.15;
  transition: transform 0.2s ease-out;
}

.shape-1 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, var(--royal) 0%, transparent 70%);
  top: -150px;
  right: -100px;
  opacity: 0.1;
}

.shape-2 {
  width: 300px;
  height: 300px;
  background: radial-gradient(circle, var(--teal) 0%, transparent 70%);
  bottom: -80px;
  left: -60px;
  opacity: 0.08;
}

.shape-3 {
  width: 180px;
  height: 180px;
  background: radial-gradient(circle, var(--violet) 0%, transparent 70%);
  top: 40%;
  right: 10%;
  opacity: 0.06;
}

.shape-4 {
  width: 120px;
  height: 120px;
  border: 2px solid rgba(255,255,255,0.06);
  background: transparent;
  bottom: 25%;
  right: 30%;
  opacity: 0.4;
  animation: float 6s ease-in-out infinite;
}

@keyframes float {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
}

/* === RIGHT: AUTH PANEL (45%) === */
.login-auth {
  flex: 0 0 45%;
  background: var(--surface);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  position: relative;
}

.login-auth::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--royal), var(--indigo), var(--teal));
  z-index: 1;
}

.auth-inner {
  flex: 1;
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  max-width: 440px;
  margin: 0 auto;
  width: 100%;
}

/* === Logo === */
.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 36px;
  text-decoration: none;
}

.auth-logo-icon {
  width: 36px;
  height: 36px;
  background: linear-gradient(135deg, var(--royal-dark), var(--indigo));
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: 800;
  font-size: 15px;
  letter-spacing: -0.5px;
}

.auth-logo-text {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

/* === Header === */
.auth-header {
  margin-bottom: 28px;
}

.auth-title {
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: -0.5px;
}

.auth-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* === Alert === */
.auth-alert {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  background: var(--red-50);
  border: 1px solid var(--red-100);
  border-radius: var(--radius-sm);
  color: var(--red-500);
  font-size: 13px;
  margin-bottom: 20px;
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.alert-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* === Auth Tabs === */
.auth-tabs {
  display: flex;
  gap: 2px;
  background: var(--gray-100);
  border-radius: var(--radius-sm);
  padding: 3px;
  margin-bottom: 24px;
}

.auth-tab {
  flex: 1;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 5px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  font-family: inherit;
  line-height: 1.3;
}

.auth-tab:hover { color: var(--text); }

.auth-tab.active {
  background: var(--surface);
  color: var(--royal);
  box-shadow: var(--shadow-xs);
}

/* === Form === */
.auth-form { display: none; }
.auth-form.active { display: block; animation: fadeIn 0.25s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.af-hint {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 20px;
  line-height: 1.5;
}

.af-group {
  margin-bottom: 18px;
}

.af-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.af-input-wrap {
  position: relative;
}

.af-input-icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s;
}

.af-input {
  width: 100%;
  padding: 11px 14px 11px 42px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  font-size: 14px;
  color: var(--text);
  background: var(--surface);
  transition: all 0.2s ease;
  outline: none;
  font-family: inherit;
  line-height: 1.4;
}

.af-input:focus {
  border-color: var(--royal);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

.af-input:focus + .af-input-icon,
.af-input-wrap:focus-within .af-input-icon {
  color: var(--royal);
}

.af-input::placeholder { color: var(--gray-300); }

.af-pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.2s;
  border-radius: 4px;
}

.af-pw-toggle:hover { color: var(--text-secondary); }

.eye-icon {
  width: 18px;
  height: 18px;
}

.af-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
}

.af-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-secondary);
  user-select: none;
  position: relative;
}

.af-checkbox input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.af-checkbox-mark {
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  flex-shrink: 0;
}

.af-checkbox input:checked + .af-checkbox-mark {
  background: var(--royal);
  border-color: var(--royal);
}

.af-checkbox input:checked + .af-checkbox-mark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -1px;
}

.af-checkbox input:focus + .af-checkbox-mark {
  box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}

.af-forgot {
  font-size: 13px;
  color: var(--royal);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s;
}

.af-forgot:hover { color: var(--royal-dark); text-decoration: underline; }

/* === Buttons === */
.af-btn {
  width: 100%;
  padding: 12px 20px;
  border: none;
  border-radius: var(--radius-xs);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  line-height: 1.4;
}

.af-btn-primary {
  background: linear-gradient(135deg, var(--royal-dark), var(--indigo));
  color: white;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
}

.af-btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(37,99,235,0.35);
}

.af-btn-primary:active { transform: translateY(0); }

.btn-arrow {
  width: 16px;
  height: 16px;
  transition: transform 0.2s;
}

.af-btn-primary:hover .btn-arrow {
  transform: translateX(3px);
}

.btn-icon {
  width: 18px;
  height: 18px;
}

.af-btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  margin-top: 8px;
}

.af-btn-ghost:hover {
  background: var(--gray-50);
  color: var(--text);
}

.af-btn-ghost:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* === OTP === */
.otp-section {
  margin-top: 20px;
  display: none;
  animation: fadeIn 0.3s ease;
}

.otp-section.visible { display: block; }

.otp-row {
  display: flex;
  gap: 10px;
  margin: 10px 0 18px;
}

.otp-input {
  width: 46px;
  height: 50px;
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  outline: none;
  transition: all 0.2s ease;
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
}

.otp-input:focus {
  border-color: var(--royal);
  box-shadow: 0 0 0 3px rgba(59,130,246,0.1);
}

/* === Magic Link Info === */
.magic-info {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  background: var(--blue-50);
  border-radius: var(--radius-xs);
  font-size: 12px;
  color: var(--blue-500);
  margin-top: 14px;
  line-height: 1.4;
}

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

/* === SSO Grid === */
.sso-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.sso-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 16px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-xs);
  background: var(--surface);
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  transition: all 0.2s ease;
  font-family: inherit;
}

.sso-btn:hover {
  border-color: var(--gray-300);
  background: var(--gray-50);
  transform: translateY(-1px);
  box-shadow: var(--shadow-xs);
}

.sso-btn-full {
  justify-content: center;
  border-style: dashed;
  color: var(--text-secondary);
}

.sso-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  border-radius: 4px;
}

/* === Divider === */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 16px;
  margin: 24px 0;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 500;
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* === Registration Links === */
.auth-reg {
  display: flex;
  gap: 10px;
}

.reg-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 14px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-xs);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  transition: all 0.2s ease;
  font-family: inherit;
}

.reg-link svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.reg-link:hover {
  border-color: var(--royal);
  color: var(--royal);
  background: var(--blue-50);
  border-style: solid;
}

/* === Trust Badges === */
.auth-badges {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border-light);
}

.auth-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--gray-50);
  border-radius: 100px;
  white-space: nowrap;
}

.auth-badge svg {
  width: 13px;
  height: 13px;
}

/* === Footer === */
.auth-footer {
  padding: 14px 32px;
  border-top: 1px solid var(--border-light);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.auth-footer-links {
  display: flex;
  gap: 20px;
}

.auth-footer-links a {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
}

.auth-footer-links a:hover { color: var(--text-secondary); }

.auth-footer-version {
  font-size: 11px;
  color: var(--gray-300);
  font-weight: 500;
}

/* === Responsive === */
@media (max-width: 1100px) {
  .brand-headline { font-size: 36px; }
  .auth-inner { padding: 40px 36px; }
}

@media (max-width: 900px) {
  .login-brand { display: none; }
  .login-auth { flex: 1; }
  .auth-inner { padding: 32px 24px; max-width: 400px; }
  .auth-footer { padding: 14px 24px; }
}

@media (max-width: 480px) {
  .auth-inner { padding: 24px 16px; }
  .auth-title { font-size: 24px; }
  .auth-tab { font-size: 11px; padding: 7px 6px; }
  .auth-reg { flex-direction: column; }
  .auth-badges { gap: 8px; }
  .auth-badge { font-size: 10px; }
  .auth-footer { flex-direction: column; text-align: center; }
  .auth-footer-links { flex-wrap: wrap; justify-content: center; }
  .otp-row { gap: 6px; }
  .otp-input { width: 40px; height: 44px; font-size: 18px; }
}

/* === Scrollbar === */
.login-auth::-webkit-scrollbar { width: 4px; }
.login-auth::-webkit-scrollbar-track { background: transparent; }
.login-auth::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
.login-auth::-webkit-scrollbar-thumb:hover { background: var(--gray-300); }
