:root {
  --blue:       #0070C0;
  --blue-d:     #004F8C;
  --blue-m:     #0090D8;
  --blue-l:     #00AEEF;
  --blue-pale:  #E8F4FB;
  --green:      #16A34A;
  --green-pale: #DCFCE7;
  --red:        #DC2626;
  --red-pale:   #FEE2E2;
  --slate:      #1E293B;
  --slate-l:    #475569;
  --muted:      #94A3B8;
  --line:       #E2E8F0;
  --bg:         #F8FAFC;
  --radius:     8px;
  --shadow-md:  0 4px 24px rgba(0,0,0,0.10);
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 14px; }
body {
  font-family: 'Instrument Sans', sans-serif;
  background: var(--bg);
  color: var(--slate);
  min-height: 100vh;
  display: flex;
  overflow: hidden;
}

/* ── LEFT BRAND PANEL ── */
.left-panel {
  width: 420px; flex-shrink: 0;
  background: var(--blue-d);
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 48px 44px;
  position: relative; overflow: hidden;
}
.geo { position: absolute; border-radius: 50%; border: 1px solid rgba(255,255,255,0.06); pointer-events: none; }
.geo-1 { width: 480px; height: 480px; top: -160px; right: -180px; }
.geo-2 { width: 300px; height: 300px; top: -80px; right: -100px; border-color: rgba(255,255,255,0.04); }
.geo-3 { width: 200px; height: 200px; bottom: 100px; left: -80px; }
.geo-blob { position: absolute; width: 160px; height: 160px; background: rgba(0,174,239,0.10); border-radius: 50%; bottom: 160px; right: -50px; pointer-events: none; }

.panel-top { position: relative; z-index: 1; }
.panel-logo { display: flex; align-items: center; gap: 12px; margin-bottom: 60px; }
.logo-mark {
  width: 38px; height: 38px; background: white; border-radius: 8px;
  display: grid; place-items: center;
  font-family: 'Playfair Display', serif; font-size: 13px; font-weight: 700;
  color: var(--blue-d); flex-shrink: 0;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.logo-text { font-size: 13.5px; font-weight: 600; color: white; line-height: 1.25; }
.logo-text span { font-size: 10.5px; font-weight: 400; opacity: 0.45; display: block; letter-spacing: 0.03em; }
.panel-headline { font-family: 'Playfair Display', serif; font-size: 34px; font-weight: 700; color: white; line-height: 1.2; margin-bottom: 14px; }
.panel-sub { font-size: 13px; color: rgba(255,255,255,0.50); line-height: 1.65; max-width: 280px; }
.panel-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 44px; }
.panel-stat { background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.09); border-radius: var(--radius); padding: 14px 16px; }
.ps-val { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 700; color: white; line-height: 1; }
.ps-label { font-size: 10.5px; color: rgba(255,255,255,0.40); margin-top: 4px; letter-spacing: 0.03em; }

.panel-bottom { position: relative; z-index: 1; }
.panel-notice {
  background: rgba(255,255,255,0.05); border: 1px solid rgba(255,255,255,0.09);
  border-radius: var(--radius); padding: 12px 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
.panel-notice svg { width: 14px; height: 14px; flex-shrink: 0; margin-top: 2px; color: var(--blue-l); }
.panel-notice p { font-size: 11.5px; color: rgba(255,255,255,0.40); line-height: 1.55; }
.panel-notice strong { color: rgba(255,255,255,0.60); }

/* ── RIGHT PANEL ── */
.right-panel { flex: 1; display: flex; flex-direction: column; overflow-y: auto; }

.right-topbar {
  height: 56px; display: flex; align-items: center; justify-content: flex-end;
  padding: 0 32px; gap: 14px;
  border-bottom: 1px solid var(--line); background: white; flex-shrink: 0;
}
.env-badge {
  font-family: 'DM Mono', monospace; font-size: 10.5px; font-weight: 500;
  padding: 3px 9px; border-radius: 20px;
  background: var(--green-pale); color: var(--green); border: 1px solid #BBF7D0;
}
.help-link { font-size: 12.5px; color: var(--muted); text-decoration: none; display: flex; align-items: center; gap: 5px; transition: color 0.15s; }
.help-link:hover { color: var(--blue); }
.help-link svg { width: 14px; height: 14px; }

.form-center { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 24px; }

.form-card { width: 100%; max-width: 400px; animation: fadeUp 0.35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: translateY(0); } }

.form-card h1 { font-family: 'Playfair Display', serif; font-size: 26px; font-weight: 700; color: var(--slate); margin-bottom: 5px; }
.form-subtitle { font-size: 13px; color: var(--muted); margin-bottom: 28px; line-height: 1.55; }

/* role tabs */
.role-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 28px; }
.role-tab {
  padding: 10px 12px; border-radius: var(--radius);
  border: 1.5px solid var(--line); background: white;
  font-family: 'Instrument Sans', sans-serif; font-size: 12.5px; font-weight: 500;
  color: var(--muted); cursor: pointer;
  display: flex; align-items: center; gap: 8px;
  transition: all 0.15s; text-align: left;
}
.role-tab:hover { border-color: var(--blue-l); color: var(--slate); }
.role-tab.active { border-color: var(--blue); background: var(--blue-pale); color: var(--blue); }
.role-tab svg { width: 15px; height: 15px; flex-shrink: 0; }

/* alerts */
.alert-error {
  display: none; align-items: center; gap: 8px;
  background: var(--red-pale); border: 1px solid #FECACA;
  border-left: 3px solid var(--red); border-radius: var(--radius);
  padding: 11px 14px; font-size: 13px; color: #7F1D1D; margin-bottom: 18px;
}
.alert-error.show { display: flex; }
.alert-error svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--red); }
.alert-success {
  display: none; align-items: center; gap: 8px;
  background: var(--green-pale); border: 1px solid #BBF7D0;
  border-left: 3px solid var(--green); border-radius: var(--radius);
  padding: 11px 14px; font-size: 13px; color: #14532D; margin-bottom: 18px;
}
.alert-success.show { display: flex; }
.alert-success svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--green); }

/* fields */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 16px; }
.field label { font-size: 11.5px; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; color: var(--slate-l); }
.field-wrap { position: relative; }
.field-wrap input {
  width: 100%; border: 1.5px solid var(--line); border-radius: var(--radius);
  padding: 10px 42px 10px 14px;
  font-family: 'Instrument Sans', sans-serif; font-size: 13.5px; color: var(--slate);
  background: white; outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-wrap input::placeholder { color: #C0C8D0; }
.field-wrap input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,112,192,0.1); }
.field-wrap input.err-inp { border-color: var(--red); box-shadow: 0 0 0 3px rgba(220,38,38,0.08); }
.fi { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; align-items: center; pointer-events: none; }
.fi svg { width: 15px; height: 15px; }
.fi.click { pointer-events: auto; cursor: pointer; }
.fi.click:hover { color: var(--blue); }
.field-err { font-size: 11.5px; color: var(--red); display: none; }
.field-err.show { display: block; }

/* form row */
.form-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.remember { display: flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.remember input { accent-color: var(--blue); width: 13px; height: 13px; cursor: pointer; }
.remember span { font-size: 12.5px; color: var(--slate-l); }
.forgot { font-size: 12.5px; color: var(--blue); font-weight: 500; cursor: pointer; }
.forgot:hover { text-decoration: underline; }

/* buttons */
.btn-login {
  width: 100%; padding: 11px 16px;
  background: var(--blue); color: white;
  border: none; border-radius: var(--radius);
  font-family: 'Instrument Sans', sans-serif; font-size: 14px; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.15s, transform 0.1s; margin-bottom: 20px;
}
.btn-login:hover { background: var(--blue-m); }
.btn-login:active { transform: scale(0.99); }
.btn-login:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }
.btn-login svg { width: 16px; height: 16px; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin-icon { animation: spin 0.75s linear infinite; }
.btn-secondary {
  width: 100%; padding: 11px 16px;
  background: white; color: var(--slate);
  border: 1.5px solid var(--line); border-radius: var(--radius);
  font-family: 'Instrument Sans', sans-serif; font-size: 14px; font-weight: 500;
  cursor: pointer; transition: border-color 0.15s, color 0.15s; margin-bottom: 16px;
}
.btn-secondary:hover { border-color: var(--blue-l); color: var(--blue); }
.btn-sso {
  width: 100%; padding: 10px 16px;
  background: white; color: var(--slate);
  border: 1.5px solid var(--line); border-radius: var(--radius);
  font-family: 'Instrument Sans', sans-serif; font-size: 13px; font-weight: 500;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: border-color 0.15s, color 0.15s; margin-bottom: 28px;
}
.btn-sso:hover { border-color: var(--blue-l); color: var(--blue); }
.btn-sso svg { width: 16px; height: 16px; }

/* divider */
.or-divider { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.or-divider hr { flex: 1; border: none; border-top: 1px solid var(--line); }
.or-divider span { font-size: 11.5px; color: var(--muted); white-space: nowrap; }

/* footer */
.form-footer { text-align: center; font-size: 12px; color: var(--muted); line-height: 1.7; }
.form-footer a { color: var(--blue); text-decoration: none; font-weight: 500; }
.form-footer a:hover { text-decoration: underline; }
.security-tag { display: flex; align-items: center; justify-content: center; gap: 6px; font-size: 11.5px; color: var(--muted); margin-top: 20px; }
.security-tag svg { width: 13px; height: 13px; color: var(--green); }

/* views */
.view { display: none; }
.view.active { display: block; }

/* back link */
.back-link { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: var(--muted); cursor: pointer; margin-bottom: 28px; transition: color 0.15s; }
.back-link:hover { color: var(--blue); }
.back-link svg { width: 14px; height: 14px; }

/* OTP */
.otp-group { display: flex; gap: 10px; justify-content: center; margin-bottom: 8px; }
.otp-input {
  width: 50px; height: 54px; border: 1.5px solid var(--line); border-radius: var(--radius);
  text-align: center; font-family: 'DM Mono', monospace; font-size: 22px; font-weight: 500;
  color: var(--slate); outline: none; transition: border-color 0.15s, box-shadow 0.15s;
}
.otp-input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(0,112,192,0.1); }
.otp-hint { text-align: center; font-size: 12.5px; color: var(--muted); margin-bottom: 28px; }
.otp-hint strong { color: var(--slate-l); }
.resend { color: var(--blue); cursor: pointer; font-weight: 500; }
.resend:hover { text-decoration: underline; }

/* toast */
#toast {
  position: fixed; bottom: 24px; right: 24px;
  background: var(--slate); color: white;
  padding: 12px 18px; border-radius: var(--radius);
  font-size: 13px; box-shadow: var(--shadow-md);
  transform: translateY(80px); opacity: 0;
  transition: all 0.3s ease; z-index: 9999; max-width: 320px;
}
#toast.show { transform: translateY(0); opacity: 1; }

@media (max-width: 768px) {
  .left-panel { display: none; }
  .right-panel { width: 100%; }
}