*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --blue: #1A3C6E; --blue-mid: #2756A0; --blue-light: #3B78D4;
  --blue-pale: #EBF2FC; --blue-subtle: #F4F8FD; --accent: #F0A500;
  --white: #FFFFFF; --text: #1A1F2E; --text-mid: #4A5568; --text-muted: #8A96A8;
  --border: #D6E4F5; --green: #16a34a;
  --shadow-lg: 0 16px 56px rgba(26,60,110,0.18);
  --font-display: "Playfair Display", serif;
  --font-body: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, sans-serif;
}
html, body { height: 100%; }
body {
  font-family: var(--font-body); background: var(--blue-subtle); color: var(--text);
  line-height: 1.6;
}

.left-panel,
.right-panel,
.auth-box,
.lp-logo,
.lp-content,
.lp-bottom,
.auth-logo-wrap,
.tab-switcher,
.auth-panel.visible {
  transition:
    opacity 0.72s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.72s cubic-bezier(0.22, 1, 0.36, 1);
  will-change: opacity, transform;
}

body.login-shell-prep:not(.login-shell-ready) .left-panel {
  opacity: 0;
  transform: translate3d(-30px, 0, 0) scale(0.985);
}

body.login-shell-prep:not(.login-shell-ready) .right-panel {
  opacity: 0;
  transform: translate3d(30px, 0, 0);
}

body.login-shell-prep:not(.login-shell-ready) .auth-box {
  opacity: 0;
  transform: translate3d(0, 28px, 0) scale(0.985);
}

body.login-shell-prep:not(.login-shell-ready) .lp-logo,
body.login-shell-prep:not(.login-shell-ready) .lp-content,
body.login-shell-prep:not(.login-shell-ready) .lp-bottom,
body.login-shell-prep:not(.login-shell-ready) .auth-logo-wrap,
body.login-shell-prep:not(.login-shell-ready) .tab-switcher,
body.login-shell-prep:not(.login-shell-ready) .auth-panel.visible {
  opacity: 0;
  transform: translate3d(0, 22px, 0);
}

body.login-shell-ready .left-panel { transition-delay: 0.04s; }
body.login-shell-ready .lp-logo { transition-delay: 0.16s; }
body.login-shell-ready .lp-content { transition-delay: 0.24s; }
body.login-shell-ready .lp-bottom { transition-delay: 0.32s; }
body.login-shell-ready .right-panel { transition-delay: 0.08s; }
body.login-shell-ready .auth-box { transition-delay: 0.18s; }
body.login-shell-ready .auth-logo-wrap { transition-delay: 0.24s; }
body.login-shell-ready .tab-switcher { transition-delay: 0.3s; }
body.login-shell-ready .auth-panel.visible { transition-delay: 0.38s; }

.auth-loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background:
    radial-gradient(circle at top, rgba(123,184,245,0.2), transparent 40%),
    linear-gradient(150deg, rgba(26,60,110,0.96), rgba(39,86,160,0.94));
  opacity: 1;
  visibility: visible;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}
.auth-loading-overlay.hidden { opacity: 0; visibility: hidden; pointer-events: none; }
.auth-loading-card {
  width: min(100%, 320px);
  padding: 2rem 1.6rem;
  border-radius: 22px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.1);
  box-shadow: 0 20px 60px rgba(7,19,45,0.32);
  backdrop-filter: blur(18px);
  text-align: center;
  color: var(--white);
}
.auth-loading-spinner {
  width: 48px;
  height: 48px;
  margin: 0 auto 1.1rem;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.14);
  border-top-color: #F6C766;
  animation: authSpin 0.9s linear infinite;
}
.auth-loading-card h2 {
  font-family: var(--font-display);
  font-size: 1.65rem;
  margin-bottom: 0.35rem;
}
.auth-loading-card p {
  color: rgba(255,255,255,0.78);
  font-size: 0.95rem;
  line-height: 1.6;
}
@keyframes authSpin {
  to { transform: rotate(360deg); }
}

@keyframes loginRingFloat {
  from { transform: translate3d(0, 0, 0) scale(0.98); }
  to { transform: translate3d(18px, -18px, 0) scale(1.03); }
}

/* Screen Reader Only */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border-width: 0;
}

/* Focus Styles */
button:focus-visible, input:focus-visible, a:focus-visible {
  outline: 2px solid var(--blue-mid); outline-offset: 2px;
}

.page-wrap { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

/* ── LEFT PANEL ── */
.left-panel {
  background: linear-gradient(150deg, var(--blue) 0%, var(--blue-mid) 60%, var(--blue-light) 100%);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 3rem; position: relative; overflow: hidden;
}
.left-panel::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 80% 20%, rgba(255,255,255,0.06), transparent 55%),
              radial-gradient(circle at 10% 80%, rgba(240,165,0,0.07), transparent 50%);
}
.lp-ring { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,0.08); pointer-events: none; }
.lp-ring:nth-child(1) { width: 350px; height: 350px; bottom: -80px; right: -80px; }
.lp-ring:nth-child(2) { width: 550px; height: 550px; bottom: -200px; right: -200px; background: rgba(255,255,255,0.02); }
.lp-ring:nth-child(1) { animation: loginRingFloat 15s ease-in-out infinite alternate; }
.lp-ring:nth-child(2) { animation: loginRingFloat 22s ease-in-out infinite alternate-reverse; }
.lp-logo { position: relative; z-index: 2; }
.lp-logo-mark {
  display: inline-block;
  color: var(--white);
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.lp-logo-mark span { color: #7BB8F5; font-weight: 400; }
.lp-content { position: relative; z-index: 2; }
.lp-content h2 { font-family: var(--font-display); font-size: 2.6rem; font-weight: 700; color: var(--white); line-height: 1.15; margin-bottom: 1.25rem; }
.lp-content h2 em { font-style: italic; color: #7BB8F5; }
.lp-content p { color: rgba(255,255,255,0.65); font-size: 0.95rem; line-height: 1.8; margin-bottom: 2.5rem; max-width: 380px; }
.lp-perks { display: flex; flex-direction: column; gap: 0.85rem; }
.lp-perk { display: flex; align-items: center; gap: 0.75rem; font-size: 0.875rem; color: rgba(255,255,255,0.85); }
.lp-perk-icon { width: 3px; height: 3px; border-radius: 8px; background: rgba(255,255,255,0.12); display: flex; align-items: center; justify-content: center; font-size: 1rem; flex-shrink: 0; }
.lp-bottom { position: relative; z-index: 2; font-size: 0.78rem; color: rgba(255,255,255,0.4); }

/* ── RIGHT PANEL ── */
.right-panel {
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem 2.5rem; background: var(--white); overflow-y: auto;
}
.auth-box { width: 100%; max-width: 440px; }
.auth-logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 1.5rem;
}
.auth-logo-mark {
  display: inline-block;
  color: var(--blue);
  font-family: var(--font-display);
  font-size: 1.9rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.auth-logo-mark span { color: var(--blue-light); font-weight: 400; }

/* ── TAB SWITCHER ── */
.tab-switcher {
  display: flex; background: var(--blue-subtle); border-radius: 12px;
  padding: 4px; margin-bottom: 2rem; border: 1px solid var(--border);
}
.tab-btn {
  flex: 1; padding: 0.65rem 1rem; border-radius: 9px; border: none; background: transparent;
  font-family: var(--font-body); font-size: 0.875rem; font-weight: 600; color: var(--text-muted);
  cursor: pointer; transition: all 0.22s;
}
.tab-btn.active { background: var(--white); color: var(--blue); box-shadow: 0 2px 8px rgba(26,60,110,0.1); }

/* ── PANELS ── */
.auth-panel { display: none; }
.auth-panel.visible { display: block; }

/* ── STEP BARS (register) ── */
.reg-steps { display: flex; gap: 4px; margin-bottom: 2rem; }
.rs { flex: 1; height: 4px; background: var(--border); border-radius: 2px; transition: background 0.3s; }
.rs.active { background: var(--blue-mid); }
.rs.done { background: var(--green); }
.step-section { display: none; }
.step-section.visible { display: block; }
.step-label { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.12em; text-transform: uppercase; color: var(--blue-mid); margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.5rem; }
.step-label::before { content: attr(data-step); width: 22px; height: 22px; border-radius: 50%; background: var(--blue-pale); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; color: var(--blue-mid); font-weight: 700; }

/* ── FORM ELEMENTS ── */
.form-field { display: flex; flex-direction: column; gap: 0.35rem; margin-bottom: 1rem; }
.form-field label { font-size: 0.78rem; font-weight: 600; color: var(--text); }
.input-wrap { position: relative; }
.input-wrap .ico { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); color: #000000; font-size: 1rem; pointer-events: none; }
.form-field input, .form-field select {
  width: 100%; padding: 0.82rem 1rem 0.82rem 2.75rem;
  border: 1.5px solid var(--border); border-radius: 10px;
  font-family: var(--font-body); font-size: 0.875rem; color: var(--text);
  background: var(--blue-subtle); outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.form-field select {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234A5568' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 1rem center; background-size: 1em; padding-right: 2.5rem;
}
.form-field input:focus, .form-field select:focus { border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(39,86,160,0.1); background: var(--white); }
.form-field input.error { border-color: #dc2626; }
.field-err { font-size: 0.72rem; color: #dc2626; margin-top: 0.2rem; display: none; }
.toggle-pw { position: absolute; right: 1rem; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-muted); font-size: 0.8rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; }

/* PASSWORD STRENGTH */
.pw-strength { margin-top: 0.5rem; }
.pw-bars { display: flex; gap: 3px; margin-bottom: 0.2rem; }
.pw-bar { flex: 1; height: 3px; background: var(--border); border-radius: 2px; transition: background 0.3s; }
.pw-bar.weak { background: #dc2626; }
.pw-bar.fair { background: var(--accent); }
.pw-bar.good { background: var(--green); }
.pw-text { font-size: 0.7rem; color: var(--text-muted); }

/* ── TERMS ── */
.terms-check { display: flex; align-items: flex-start; gap: 0.6rem; font-size: 0.82rem; color: var(--text-mid); margin-bottom: 1.5rem; cursor: pointer; }
.terms-check input { accent-color: var(--blue-mid); margin-top: 2px; flex-shrink: 0; }
.terms-check a { color: var(--blue-mid); text-decoration: none; font-weight: 600; }

/* ── FORM ROW ── */
.form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.remember { display: flex; align-items: center; gap: 0.5rem; font-size: 0.82rem; color: var(--text-mid); cursor: pointer; }
.remember input[type=checkbox] { accent-color: var(--blue-mid); width: 15px; height: 15px; }
.forgot { font-size: 0.82rem; color: var(--blue-mid); text-decoration: none; font-weight: 600; }
.forgot:hover { text-decoration: underline; }

/* ── BUTTONS ── */
.btn-main {
  width: 100%; padding: 1rem; border-radius: 10px; background: var(--blue-mid);
  color: var(--white); font-family: var(--font-body); font-size: 0.9rem; font-weight: 700;
  border: none; cursor: pointer; transition: background 0.2s, transform 0.15s;
  letter-spacing: 0.03em; margin-bottom: 1rem; line-height: 1.5;
}
.btn-main:hover { background: var(--blue); transform: translateY(-1px); }
.btn-main:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-back {
  width: 100%; padding: 0.82rem; border-radius: 10px; border: 1.5px solid var(--border);
  background: transparent; color: var(--text-mid); font-family: var(--font-body);
  font-size: 0.875rem; font-weight: 600; cursor: pointer;
  transition: border-color 0.2s, color 0.2s; margin-bottom: 1rem;
}
.btn-back:hover { border-color: var(--blue-mid); color: var(--blue-mid); }

/* ── OTP ── */
.otp-container { display: flex; gap: 0.6rem; justify-content: center; margin: 1.25rem 0; }
.otp-container input {
  width: 50px; height: 54px; text-align: center; border: 1.5px solid var(--border); border-radius: 10px;
  font-family: var(--font-display); font-size: 1.4rem; font-weight: 700; color: var(--blue);
  background: var(--blue-subtle); outline: none; transition: border-color 0.2s, box-shadow 0.2s;
}
.otp-container input:focus { border-color: var(--blue-mid); box-shadow: 0 0 0 3px rgba(39,86,160,0.1); background: var(--white); }
.otp-error {
  color: #dc2626; font-size: 0.82rem; text-align: center; margin: 0.75rem 0;
  opacity: 0; transition: opacity 0.3s;
}
.otp-error.show { opacity: 1; }
.resend-btn {
  background: none; border: none; color: var(--blue-mid); font-family: var(--font-body);
  font-size: 0.82rem; font-weight: 700; cursor: pointer; text-decoration: underline;
}

/* ── SUCCESS ── */
.success-state { text-align: center; padding: 2rem 0; }
.success-icon { font-size: 3.5rem; margin-bottom: 1rem; }
.success-state h2 { font-family: var(--font-display); font-size: 1.75rem; font-weight: 700; color: var(--blue); margin-bottom: 0.75rem; }
.success-state p { color: var(--text-mid); font-size: 0.875rem; line-height: 1.75; margin-bottom: 2rem; }

/* ── TRUST BADGES ── */
.trust-badges { display: flex; align-items: center; justify-content: center; gap: 1.5rem; margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--border); }
.trust-badge { display: flex; align-items: center; gap: 0.4rem; font-size: 0.72rem; color: #000000; }

/* ── ERROR MESSAGE ── */
.login-err { color: #dc2626; font-size: 0.82rem; text-align: center; padding: 0.6rem; background: #fef2f2; border-radius: 8px; border: 1px solid #fecaca; margin-top: 0.5rem; display: none; }

/* ── RESPONSIVE ── */
@media (max-width: 768px) {
  .page-wrap { grid-template-columns: 1fr; }
  .left-panel { display: none; }
  .right-panel { padding: 2rem 1.5rem; align-items: flex-start; padding-top: 3rem; }
  .auth-logo-mark { font-size: 1.75rem; }
}
@media (max-width: 400px) {
  .field-row { grid-template-columns: 1fr; }
  .otp-input { width: 42px; height: 46px; font-size: 1.2rem; }
  .lp-logo-mark { font-size: 1.75rem; }
  .auth-logo-mark { font-size: 1.6rem; }
}

/* Google Translate Widget */
#google_translate_element {
  font-size: 14px;
}
#google_translate_element .goog-te-gadget-simple {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--border);
  border-radius: 50%;
  padding: 6px;
  font-size: 0;
  width: 30px;
  height: 30px;
  color: var(--blue);
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"><path d="M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm-1 17.93c-3.94-.49-7-3.85-7-7.93 0-.62.08-1.21.21-1.79L9 15v1c0 1.1.9 2 2 2v1.93zm6.9-2.54c-.26-.81-1-1.39-1.9-1.39h-1v-3c0-.55-.45-1-1-1H8v-2h2c.55 0 1-.45 1-1V7h2c1.1 0 2-.9 2-2v-.41c2.93 1.19 5 4.06 5 7.41 0 2.08-.8 3.97-2.1 5.39z"/></svg>');
  background-size: 18px;
  background-repeat: no-repeat;
  background-position: center;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
#google_translate_element .goog-te-gadget-simple:hover {
  background-color: var(--blue-pale);
  border-color: var(--blue);
  transform: scale(1.1);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

@media (prefers-reduced-motion: reduce) {
  .auth-loading-spinner,
  .lp-ring:nth-child(1),
  .lp-ring:nth-child(2) {
    animation: none;
  }

  .left-panel,
  .right-panel,
  .auth-box,
  .lp-logo,
  .lp-content,
  .lp-bottom,
  .auth-logo-wrap,
  .tab-switcher,
  .auth-panel.visible {
    transition: none;
  }

  body.login-shell-prep:not(.login-shell-ready) .left-panel,
  body.login-shell-prep:not(.login-shell-ready) .right-panel,
  body.login-shell-prep:not(.login-shell-ready) .auth-box,
  body.login-shell-prep:not(.login-shell-ready) .lp-logo,
  body.login-shell-prep:not(.login-shell-ready) .lp-content,
  body.login-shell-prep:not(.login-shell-ready) .lp-bottom,
  body.login-shell-prep:not(.login-shell-ready) .auth-logo-wrap,
  body.login-shell-prep:not(.login-shell-ready) .tab-switcher,
  body.login-shell-prep:not(.login-shell-ready) .auth-panel.visible {
    opacity: 1;
    transform: none;
  }
}
