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

:root {
  --primary: #1a3a6b;
  --primary-dark: #0f2347;
  --primary-light: #2563eb;
  --accent: #e8b84b;
  --accent-dark: #c9971a;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-300: #cbd5e1;
  --gray-500: #64748b;
  --gray-700: #334155;
  --danger: #dc2626;
  --success: #16a34a;
  --warning: #d97706;
  --shadow: 0 20px 60px rgba(0,0,0,0.15);
  --radius: 16px;
}

body {
  font-family: 'Inter', sans-serif;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0f2347 0%, #1a3a6b 50%, #1e4d8c 100%);
  position: relative;
  overflow: hidden;
}

/* Animated background bubbles */
.bg-animated { position: fixed; inset: 0; pointer-events: none; z-index: 0; }
.bubble {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  animation: float 8s infinite ease-in-out;
}
.b1 { width: 400px; height: 400px; top: -100px; left: -100px; animation-delay: 0s; }
.b2 { width: 300px; height: 300px; top: 60%; right: -80px; animation-delay: 2s; }
.b3 { width: 200px; height: 200px; bottom: -60px; left: 30%; animation-delay: 4s; }
.b4 { width: 150px; height: 150px; top: 20%; right: 25%; animation-delay: 1s; }
.b5 { width: 250px; height: 250px; top: 40%; left: 20%; animation-delay: 3s; }

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(10deg); }
}

.login-wrapper {
  position: relative; z-index: 1;
  display: flex;
  width: min(960px, 95vw);
  min-height: 580px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  background: var(--white);
}

/* ── Brand Panel ── */
.brand-panel {
  width: 42%;
  background: linear-gradient(160deg, #1a3a6b 0%, #0f2347 60%, #0a1628 100%);
  color: var(--white);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 48px 40px;
  position: relative;
  overflow: hidden;
}
.brand-panel::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  border-radius: 50%;
  background: rgba(232,184,75,0.08);
  top: -80px; right: -80px;
}
.brand-panel::after {
  content: '';
  position: absolute;
  width: 200px; height: 200px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  bottom: -40px; left: -40px;
}

.brand-content { position: relative; z-index: 1; }

.logo-container { margin-bottom: 24px; }
.logo-default svg { width: 72px; height: 72px; filter: drop-shadow(0 4px 12px rgba(0,0,0,0.3)); }
.logo-container img { width: 90px; height: 90px; object-fit: contain; border-radius: 12px; background: rgba(255,255,255,0.1); padding: 8px; }

.brand-name {
  font-size: 42px;
  font-weight: 800;
  letter-spacing: -1px;
  color: var(--white);
  line-height: 1;
  margin-bottom: 10px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.3);
}
.brand-name span { color: var(--accent); }

.brand-tagline {
  font-size: 14px;
  font-weight: 400;
  color: rgba(255,255,255,0.7);
  letter-spacing: 0.5px;
  margin-bottom: 32px;
  font-style: italic;
}

.brand-divider {
  width: 48px; height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
  margin-bottom: 28px;
}

.brand-features { display: flex; flex-direction: column; gap: 12px; }
.feature-item {
  display: flex; align-items: center; gap: 12px;
  font-size: 13px; color: rgba(255,255,255,0.75);
}
.feature-icon { font-size: 18px; }

.brand-footer {
  position: relative; z-index: 1;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

/* ── Login Panel ── */
.login-panel {
  flex: 1;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
}

.login-card { width: 100%; max-width: 380px; }

.login-header { margin-bottom: 28px; }
.login-header h2 {
  font-size: 26px; font-weight: 700;
  color: var(--gray-700); margin-bottom: 6px;
}
.login-header p { font-size: 14px; color: var(--gray-500); }

/* Alerts */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
}
.alert.alert-success { background: #f0fdf4; border-color: #bbf7d0; color: var(--success); }
.alert.alert-warning { background: #fffbeb; border-color: #fde68a; color: var(--warning); }

/* Form */
.form-group { margin-bottom: 18px; }
.form-group label {
  display: block;
  font-size: 13px; font-weight: 500;
  color: var(--gray-700);
  margin-bottom: 6px;
}
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}
.input-icon {
  position: absolute; left: 14px;
  font-size: 16px; z-index: 1;
  pointer-events: none;
}
.input-wrapper input {
  width: 100%;
  padding: 12px 44px 12px 42px;
  border: 1.5px solid var(--gray-300);
  border-radius: 10px;
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  color: var(--gray-700);
  background: var(--gray-50);
  transition: all 0.2s;
  outline: none;
}
.input-wrapper input:focus {
  border-color: var(--primary-light);
  background: var(--white);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.toggle-password {
  position: absolute; right: 12px;
  background: none; border: none;
  cursor: pointer; font-size: 16px;
  padding: 4px; color: var(--gray-500);
  transition: color 0.2s;
}
.toggle-password:hover { color: var(--primary); }

.btn-login {
  width: 100%;
  padding: 13px;
  background: linear-gradient(135deg, var(--primary-light), var(--primary));
  color: var(--white);
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: 'Inter', sans-serif;
  cursor: pointer;
  transition: all 0.25s;
  position: relative;
  letter-spacing: 0.3px;
  margin-top: 4px;
}
.btn-login:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(37,99,235,0.35);
}
.btn-login:active { transform: translateY(0); }
.btn-login:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }
.btn-loader { display: inline-block; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Password policy hint */
.policy-hint {
  margin-top: 18px;
  font-size: 12px;
  color: var(--gray-500);
}
.policy-hint summary {
  cursor: pointer;
  color: var(--primary-light);
  font-weight: 500;
  user-select: none;
}
.policy-hint ul {
  margin-top: 8px;
  padding-left: 18px;
  display: flex; flex-direction: column; gap: 4px;
  background: var(--gray-50);
  padding: 10px 10px 10px 24px;
  border-radius: 8px;
  border: 1px solid var(--gray-100);
  color: var(--gray-700);
}

.login-footer-note {
  margin-top: 24px;
  text-align: center;
  font-size: 12px;
  color: var(--gray-500);
}

/* ── Change Password Modal ── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(15, 35, 71, 0.7);
  backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
}
.modal-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 40px;
  width: min(480px, 100%);
  box-shadow: var(--shadow);
  animation: slideUp 0.3s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-header { margin-bottom: 24px; }
.modal-header h3 { font-size: 22px; font-weight: 700; color: var(--gray-700); margin-bottom: 6px; }
.modal-header p { font-size: 13px; color: var(--gray-500); }

/* Strength bar */
.strength-bar {
  height: 4px;
  background: var(--gray-100);
  border-radius: 2px;
  margin-top: 8px;
  overflow: hidden;
}
.strength-fill {
  height: 100%; border-radius: 2px;
  transition: all 0.3s ease;
  width: 0%;
}
.strength-label {
  font-size: 11px;
  margin-top: 4px;
  font-weight: 500;
}

/* Policy checklist */
.policy-checklist {
  background: var(--gray-50);
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.check-item {
  font-size: 12px;
  color: var(--gray-500);
  display: flex; align-items: center; gap: 6px;
}
.check-item.valid { color: var(--success); }
.check-item .chk { font-size: 14px; }

/* Responsive */
@media (max-width: 640px) {
  .brand-panel { display: none; }
  .login-panel { padding: 32px 24px; }
  .login-wrapper { width: 100vw; min-height: 100vh; border-radius: 0; }
}
