/* ===== RESET & BASE ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --navy: #0A2647;
  --navy-light: #144272;
  --navy-dark: #061a30;
  --gold: #D4AF37;
  --gold-light: #e8c84a;
  --white: #ffffff;
  --gray-50: #f8fafc;
  --gray-100: #f1f5f9;
  --gray-200: #e2e8f0;
  --gray-400: #94a3b8;
  --gray-600: #475569;
  --gray-800: #1e293b;
  --green: #10b981;
  --red: #ef4444;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(10,38,71,0.10);
  --shadow-lg: 0 12px 48px rgba(10,38,71,0.18);
}

html, body { height: 100%; font-family: 'Inter', sans-serif; }

body {
  display: flex; min-height: 100vh;
  background: var(--gray-50); color: var(--gray-800); overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }
input, button { font-family: inherit; font-size: inherit; }

/* ===== LAYOUT ===== */
.login-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
  width: 100%;
}

/* ===== BRAND PANEL ===== */
.brand-panel {
  background: linear-gradient(145deg, var(--navy-dark) 0%, var(--navy) 55%, var(--navy-light) 100%);
  position: relative; overflow: hidden;
  display: flex; align-items: stretch;
}

.brand-bg { position: absolute; inset: 0; }
.bg-circle {
  position: absolute; border-radius: 50%;
  border: 1px solid rgba(212,175,55,0.12);
  background: rgba(212,175,55,0.03);
}
.bg-circle.bc1 { width: 600px; height: 600px; top: -200px; right: -200px; animation: bRotate 20s linear infinite; }
.bg-circle.bc2 { width: 350px; height: 350px; bottom: -100px; left: -80px; animation: bRotate 14s linear infinite reverse; }
.bg-circle.bc3 { width: 180px; height: 180px; top: 40%; left: 40%; animation: bPulse 5s ease-in-out infinite; }

.bg-grid {
  position: absolute; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
                    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 48px 48px;
}

@keyframes bRotate { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes bPulse { 0%,100% { transform: scale(1); opacity:0.5; } 50% { transform: scale(1.15); opacity:1; } }

.brand-inner {
  position: relative; z-index: 1;
  display: flex; flex-direction: column; gap: 36px;
  padding: 48px 52px; justify-content: space-between;
  width: 100%;
}

/* Logo */
.brand-logo {
  display: inline-flex; align-items: center; gap: 10px;
  color: var(--white); font-size: 1.2rem; font-weight: 700;
}
.brand-logo .logo-icon {
  width: 40px; height: 40px; border-radius: 10px;
  background: rgba(212,175,55,0.2); border: 1.5px solid rgba(212,175,55,0.4);
  color: var(--gold); display: flex; align-items: center; justify-content: center;
  font-family: 'Playfair Display', serif; font-size: 1.3rem; font-weight: 800;
}
.brand-logo strong { color: var(--gold); }

/* Brand main text */
.brand-main { flex: 1; }
.brand-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: rgba(212,175,55,0.15); color: var(--gold);
  border: 1px solid rgba(212,175,55,0.3);
  padding: 5px 14px; border-radius: 100px;
  font-size: 0.75rem; font-weight: 700; letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 18px;
}
.brand-main h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(1.8rem, 3vw, 2.6rem); line-height: 1.15;
  color: var(--white); font-weight: 800; margin-bottom: 16px;
}
.brand-main h1 .gold { color: var(--gold); }
.brand-main p { color: rgba(255,255,255,0.65); font-size: 0.95rem; line-height: 1.7; max-width: 380px; }

/* Stats */
.brand-stats {
  display: flex; align-items: center; gap: 24px;
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius); padding: 20px 28px;
}
.b-stat { text-align: center; }
.b-stat-num { font-family: 'Playfair Display', serif; font-size: 1.6rem; font-weight: 800; color: var(--white); line-height: 1; }
.b-stat-num span { font-size: 1rem; color: var(--gold); }
.b-stat-label { font-size: 0.72rem; color: rgba(255,255,255,0.45); margin-top: 4px; font-weight: 500; }
.b-stat-divider { width: 1px; height: 36px; background: rgba(255,255,255,0.12); }

/* Quote */
.brand-quote {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.08);
  border-left: 3px solid var(--gold); border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px;
}
.quote-icon { font-size: 2rem; color: var(--gold); line-height: 1; margin-bottom: 8px; font-family: Georgia, serif; }
.brand-quote p { color: rgba(255,255,255,0.75); font-size: 0.88rem; line-height: 1.6; font-style: italic; margin-bottom: 14px; }
.quote-author { display: flex; align-items: center; gap: 10px; }
.qa-avatar {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--gold); color: var(--navy-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; font-weight: 800; flex-shrink: 0;
}
.quote-author strong { display: block; color: var(--white); font-size: 0.85rem; }
.quote-author span { color: rgba(255,255,255,0.45); font-size: 0.75rem; }

/* Secure items */
.brand-secure { display: flex; gap: 20px; flex-wrap: wrap; }
.secure-item {
  display: flex; align-items: center; gap: 7px;
  color: rgba(255,255,255,0.5); font-size: 0.78rem; font-weight: 500;
}
.secure-item svg { width: 15px; height: 15px; color: var(--gold); flex-shrink: 0; }

/* ===== FORM PANEL ===== */
.form-panel {
  display: flex; align-items: center; justify-content: center;
  background: var(--white); padding: 40px 24px;
  overflow-y: auto;
}
.form-inner { width: 100%; max-width: 420px; }

.form-header { margin-bottom: 28px; }
.form-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.9rem; font-weight: 800; color: var(--navy); margin-bottom: 6px;
}
.form-header p { color: var(--gray-600); font-size: 0.92rem; }

/* Tabs */
.login-tabs {
  display: flex; background: var(--gray-100); border-radius: 10px;
  padding: 4px; margin-bottom: 28px; gap: 4px;
}
.tab-btn {
  flex: 1; padding: 9px; border-radius: 8px;
  border: none; background: transparent; cursor: pointer;
  font-size: 0.87rem; font-weight: 600; color: var(--gray-400);
  transition: all 0.25s ease;
}
.tab-btn.active { background: var(--white); color: var(--navy); box-shadow: 0 2px 8px rgba(0,0,0,0.08); }

/* Form groups */
.login-form { display: flex; flex-direction: column; gap: 20px; }

.form-group label {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 0.83rem; font-weight: 600; color: var(--gray-800); margin-bottom: 7px;
}
.forgot-link { color: var(--gold); font-weight: 500; font-size: 0.8rem; transition: color 0.2s; }
.forgot-link:hover { color: var(--navy); }

.input-wrapper { position: relative; }
.input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  pointer-events: none;
}
.input-icon svg { width: 17px; height: 17px; color: var(--gray-400); }
.input-wrapper input {
  width: 100%; padding: 12px 44px 12px 42px;
  border: 1.5px solid var(--gray-200); border-radius: 10px;
  font-size: 0.92rem; color: var(--gray-800); background: var(--white);
  outline: none; transition: all 0.25s ease;
}
.input-wrapper input:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(10,38,71,0.08); }
.input-wrapper input::placeholder { color: var(--gray-400); }

.eye-btn {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  background: none; border: none; cursor: pointer; padding: 2px;
  color: var(--gray-400); transition: color 0.2s;
}
.eye-btn:hover { color: var(--navy); }
.eye-btn svg { width: 17px; height: 17px; display: block; }

/* Checkbox */
.form-options { margin-top: -4px; }
.checkbox-label {
  display: flex; align-items: center; gap: 10px;
  font-size: 0.85rem; color: var(--gray-600); cursor: pointer;
}
.checkbox-label input { display: none; }
.checkmark {
  width: 18px; height: 18px; border-radius: 5px;
  border: 1.5px solid var(--gray-200); background: var(--white);
  flex-shrink: 0; transition: all 0.2s ease;
  display: flex; align-items: center; justify-content: center;
}
.checkbox-label input:checked + .checkmark {
  background: var(--navy); border-color: var(--navy);
}
.checkbox-label input:checked + .checkmark::after {
  content: '✓'; color: var(--white); font-size: 11px; font-weight: 700;
}

/* Error */
.form-error {
  display: flex; align-items: center; gap: 8px;
  background: rgba(239,68,68,0.08); border: 1px solid rgba(239,68,68,0.2);
  color: var(--red); border-radius: 8px; padding: 10px 14px;
  font-size: 0.85rem; animation: shake 0.4s ease;
}
.form-error svg { width: 16px; height: 16px; flex-shrink: 0; }
@keyframes shake {
  0%,100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* Login Button */
.btn-login {
  width: 100%; padding: 14px;
  background: var(--navy); color: var(--white);
  border: none; border-radius: 10px; cursor: pointer;
  font-size: 0.95rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: all 0.25s ease; position: relative; overflow: hidden;
}
.btn-login::before {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(135deg, transparent 40%, rgba(212,175,55,0.15));
}
.btn-login:hover { background: var(--navy-light); transform: translateY(-2px); box-shadow: 0 8px 28px rgba(10,38,71,0.3); }
.btn-login:active { transform: translateY(0); }
.btn-arrow { width: 16px; height: 16px; flex-shrink: 0; transition: transform 0.2s; }
.btn-login:hover .btn-arrow { transform: translateX(3px); }
.spinner { width: 18px; height: 18px; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Divider */
.form-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 24px 0; color: var(--gray-400); font-size: 0.8rem;
}
.form-divider::before, .form-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--gray-200);
}

/* Social */
.social-login { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 24px; }
.social-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px; border-radius: 10px;
  border: 1.5px solid var(--gray-200); background: var(--white);
  font-size: 0.87rem; font-weight: 600; color: var(--gray-700, #374151);
  cursor: pointer; transition: all 0.25s ease;
}
.social-btn:hover { border-color: var(--navy); background: var(--gray-50); box-shadow: 0 2px 12px rgba(0,0,0,0.06); }
.social-btn svg { width: 18px; height: 18px; flex-shrink: 0; }

/* Links */
.register-link, .back-link { text-align: center; font-size: 0.85rem; color: var(--gray-500, #6b7280); margin-top: 12px; }
.register-link a, .back-link a { color: var(--navy); font-weight: 600; }
.register-link a:hover, .back-link a:hover { color: var(--gold); }
.back-link { margin-top: 8px; }
.back-link a { font-weight: 500; color: var(--gray-400); font-size: 0.82rem; }

/* ===== SUCCESS STATE ===== */
.login-success {
  text-align: center; padding: 20px; display: none;
}
.success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(16,185,129,0.1); border: 2px solid var(--green);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 16px; font-size: 1.8rem; color: var(--green);
  animation: successPop 0.5s cubic-bezier(0.34,1.56,0.64,1);
}
@keyframes successPop { from { transform: scale(0.5); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .login-layout { grid-template-columns: 1fr; }
  .brand-panel { min-height: auto; }
  .brand-inner { padding: 32px; gap: 24px; }
  .brand-main h1 { font-size: 1.8rem; }
  .brand-stats { justify-content: center; }
  .brand-quote { display: none; }
}
@media (max-width: 480px) {
  .form-panel { padding: 28px 16px; }
  .brand-panel { display: none; }
}
