:root {
  --primary: #1e40af;
  --primary-dark: #0f2f78;
  --primary-deep: #0b2a6f;
  --primary-light: #eff6ff;
  --secondary: #2563eb;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #172033;
  --muted: #7b8497;
  --border: #e8edf5;
  --shadow: 0 25px 70px rgba(15, 47, 120, 0.16);
  --radius: 26px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}
button, input { font-family: inherit; }
button { cursor: pointer; }
a { text-decoration: none; color: inherit; }

/* PAGE LAYOUT */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(460px, 0.85fr);
}

/* LEFT PANEL */
.visual-panel {
  min-height: 100vh;
  position: relative;
  overflow: hidden;
  color: white;
  background: linear-gradient(135deg, rgba(11, 42, 111, 0.97) 0%, rgba(15, 47, 120, 0.96) 38%, rgba(30, 64, 175, 0.95) 70%, rgba(37, 99, 235, 0.94) 100%);
  padding: 44px 52px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.visual-panel::before {
  content: ""; position: absolute; width: 430px; height: 430px;
  border-radius: 50%; background: rgba(255,255,255,0.055); top: -210px; right: -140px;
}
.visual-panel::after {
  content: ""; position: absolute; width: 280px; height: 280px;
  border-radius: 50%; border: 55px solid rgba(255,255,255,0.045); left: -140px; bottom: -120px;
}
.visual-grid {
  position: absolute; inset: 0; opacity: 0.08;
  background-image: linear-gradient(rgba(255,255,255,0.35) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.35) 1px, transparent 1px);
  background-size: 50px 50px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,0.7), transparent);
}

/* BRAND */
.brand { position: relative; z-index: 3; display: flex; align-items: center; gap: 14px; }
.brand-logo {
  width: 52px; height: 52px; border-radius: 16px; background: white; color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 23px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.16); flex-shrink: 0;
}
.brand-text h2 { font-size: 17px; font-weight: 700; line-height: 1.3; }
.brand-text span { display: block; font-size: 10px; color: rgba(255,255,255,0.7); letter-spacing: 0.6px; margin-top: 2px; }

/* VISUAL CONTENT */
.visual-content { position: relative; z-index: 3; max-width: 680px; padding: 50px 0; }
.visual-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 30px;
  background: rgba(255,255,255,0.11); border: 1px solid rgba(255,255,255,0.13);
  font-size: 10px; margin-bottom: 18px; backdrop-filter: blur(10px);
}
.visual-badge i { color: #6ee7b7; }
.visual-content h1 { font-size: clamp(32px, 4vw, 56px); line-height: 1.12; letter-spacing: -1.7px; margin-bottom: 18px; max-width: 650px; }
.visual-content h1 span { color: #bfdbfe; }
.visual-content > p { max-width: 590px; font-size: 13px; line-height: 1.9; color: rgba(255,255,255,0.72); }

/* FEATURES */
.feature-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 32px; max-width: 680px; }
.feature-item { padding: 15px; border-radius: 17px; background: rgba(255,255,255,0.09); border: 1px solid rgba(255,255,255,0.11); backdrop-filter: blur(10px); }
.feature-icon { width: 35px; height: 35px; border-radius: 11px; background: rgba(255,255,255,0.12); display: flex; align-items: center; justify-content: center; font-size: 13px; margin-bottom: 10px; }
.feature-item h4 { font-size: 10px; font-weight: 600; margin-bottom: 4px; }
.feature-item p { font-size: 8px; color: rgba(255,255,255,0.6); line-height: 1.5; }

/* STATUS & FOOTER */
.visual-footer { position: relative; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 20px; padding-top: 20px; }
.system-status { display: flex; align-items: center; gap: 9px; font-size: 10px; color: rgba(255,255,255,0.7); }
.status-dot { width: 9px; height: 9px; border-radius: 50%; background: #34d399; box-shadow: 0 0 0 6px rgba(52,211,153,0.12); }
.copyright { font-size: 9px; color: rgba(255,255,255,0.5); }

/* RIGHT PANEL (FORM) */
.form-panel {
  min-height: 100vh; background: #ffffff; display: flex; align-items: center; justify-content: center;
  padding: 45px; position: relative;
}
.form-panel::before {
  content: ""; position: absolute; width: 240px; height: 240px; border-radius: 50%;
  background: #eff6ff; top: -120px; right: -110px;
}
.login-wrapper { width: 100%; max-width: 410px; position: relative; z-index: 2; }

/* MOBILE BRAND */
.mobile-brand { display: none; align-items: center; gap: 11px; margin-bottom: 28px; }
.mobile-brand-logo {
  width: 45px; height: 45px; border-radius: 14px; background: linear-gradient(135deg, var(--primary-dark), var(--secondary));
  color: white; display: flex; align-items: center; justify-content: center; font-size: 19px;
}
.mobile-brand h3 { font-size: 14px; line-height: 1.3; }
.mobile-brand span { font-size: 9px; color: var(--muted); }

/* FORM HEADER */
.form-header { margin-bottom: 29px; }
.form-eyebrow {
  display: inline-flex; align-items: center; gap: 7px; font-size: 9px; font-weight: 600; color: var(--primary);
  background: var(--primary-light); padding: 6px 10px; border-radius: 30px; margin-bottom: 13px;
}
.form-header h2 { font-size: 27px; letter-spacing: -0.7px; margin-bottom: 8px; }
.form-header p { font-size: 11px; line-height: 1.7; color: var(--muted); }

/* ROLE INFO */
.role-info {
  display: flex; align-items: center; gap: 11px; padding: 12px 13px; background: #f8fbff;
  border: 1px solid #dbeafe; border-radius: 14px; margin-bottom: 20px;
}
.role-info-icon {
  width: 36px; height: 36px; border-radius: 11px; background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 13px;
}
.role-info-text h4 { font-size: 10px; font-weight: 600; margin-bottom: 2px; }
.role-info-text p { font-size: 8.5px; color: var(--muted); line-height: 1.5; }

/* INPUTS */
.form-group { margin-bottom: 17px; }
.form-label { display: block; font-size: 10px; font-weight: 600; color: #3d4759; margin-bottom: 7px; }
.input-wrapper {
  height: 52px; display: flex; align-items: center; border: 1.5px solid var(--border);
  border-radius: 14px; background: #ffffff; transition: 0.22s ease; overflow: hidden;
}
.input-wrapper:focus-within { border-color: #60a5fa; box-shadow: 0 0 0 4px rgba(37,99,235,0.08); }
.input-icon { width: 48px; height: 100%; display: flex; align-items: center; justify-content: center; color: #9aa3b4; font-size: 13px; flex-shrink: 0; }
.input-wrapper:focus-within .input-icon { color: var(--primary); }
.input-wrapper input { flex: 1; min-width: 0; height: 100%; border: none; outline: none; background: transparent; color: var(--text); font-size: 11px; padding-right: 12px; }
.input-wrapper input::placeholder { color: #b1b8c5; }
.password-toggle { width: 46px; height: 100%; border: none; background: transparent; color: #9aa3b4; display: flex; align-items: center; justify-content: center; font-size: 13px; transition: 0.2s; }
.password-toggle:hover { color: var(--primary); }

/* OPTIONS */
.form-options { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 2px 0 22px; }
.remember { display: flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.remember input { display: none; }
.custom-checkbox { width: 17px; height: 17px; border: 1.5px solid #d8dee9; border-radius: 5px; display: flex; align-items: center; justify-content: center; transition: 0.2s; color: white; font-size: 8px; }
.remember input:checked + .custom-checkbox { background: var(--primary); border-color: var(--primary); }
.remember input:checked + .custom-checkbox::after { content: "\f00c"; font-family: "Font Awesome 6 Free"; font-weight: 900; }
.remember span:last-child { font-size: 9px; color: var(--muted); }
.forgot-link { border: none; background: transparent; color: var(--primary); font-size: 9px; font-weight: 600; }
.forgot-link:hover { text-decoration: underline; }

/* BUTTON */
.login-button {
  width: 100%; height: 53px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary-dark), var(--primary), var(--secondary));
  color: white; font-size: 11px; font-weight: 600; box-shadow: 0 14px 28px rgba(37,99,235,0.23);
  display: flex; align-items: center; justify-content: center; gap: 9px; transition: 0.25s ease;
  position: relative; overflow: hidden;
}
.login-button::before {
  content: ""; position: absolute; top: 0; left: -100%; width: 80%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.16), transparent); transition: 0.55s ease;
}
.login-button:hover { transform: translateY(-2px); box-shadow: 0 18px 34px rgba(37,99,235,0.30); }
.login-button:hover::before { left: 130%; }
.login-button:active { transform: translateY(0); }
.login-button.loading { pointer-events: none; opacity: 0.9; }
.button-spinner {
  width: 17px; height: 17px; border: 2px solid rgba(255,255,255,0.35);
  border-top-color: white; border-radius: 50%; animation: spin 0.75s linear infinite; display: none;
}
.login-button.loading .button-spinner { display: block; }
.login-button.loading .button-icon { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* SUPPORT & SECURITY */
.support-box { margin-top: 25px; padding-top: 21px; border-top: 1px solid var(--border); text-align: center; }
.support-box p { font-size: 9px; color: var(--muted); line-height: 1.7; }
.support-box button { border: none; background: transparent; color: var(--primary); font-size: 9px; font-weight: 600; margin-top: 5px; }
.security-footer { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 22px; color: #a0a8b8; font-size: 8px; }
.security-footer i { color: #10b981; }

/* TOAST */
.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; }
.toast { width: min(350px, calc(100vw - 30px)); background: white; border: 1px solid var(--border); box-shadow: 0 20px 50px rgba(15,23,42,0.16); border-radius: 15px; padding: 13px 14px; display: flex; align-items: flex-start; gap: 11px; animation: toastIn 0.35s ease; }
.toast.hide { animation: toastOut 0.3s ease forwards; }
.toast-icon { width: 35px; height: 35px; border-radius: 11px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 12px; }
.toast.error .toast-icon { background: #fef2f2; color: var(--danger); }
.toast.success .toast-icon { background: #ecfdf5; color: var(--success); }
.toast.warning .toast-icon { background: #fff7ed; color: var(--warning); }
.toast-content { flex: 1; min-width: 0; }
.toast-content h4 { font-size: 10px; margin-bottom: 3px; }
.toast-content p { font-size: 8.5px; color: var(--muted); line-height: 1.5; }
@keyframes toastIn { from { opacity: 0; transform: translateX(25px); } to { opacity: 1; transform: translateX(0); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(25px); } }

/* MODAL */
.modal-overlay { position: fixed; inset: 0; background: rgba(15,23,42,0.55); backdrop-filter: blur(5px); z-index: 5000; display: flex; align-items: center; justify-content: center; padding: 20px; opacity: 0; visibility: hidden; transition: 0.25s; }
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal { width: 100%; max-width: 400px; background: white; border-radius: 21px; box-shadow: 0 30px 80px rgba(15,23,42,0.22); transform: translateY(15px) scale(0.98); transition: 0.25s; overflow: hidden; }
.modal-overlay.show .modal { transform: translateY(0) scale(1); }
.modal-header { padding: 19px 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--border); }
.modal-header h3 { font-size: 13px; }
.modal-close { width: 34px; height: 34px; border: none; border-radius: 10px; background: #f4f7fb; color: var(--muted); }
.modal-body { padding: 20px; }
.modal-body p { font-size: 10px; color: var(--muted); line-height: 1.7; margin-bottom: 15px; }
.modal-button { width: 100%; height: 45px; border: none; border-radius: 12px; background: var(--primary); color: white; font-size: 10px; font-weight: 600; margin-top: 5px; }

/* RESPONSIVE */
@media (max-width: 1100px) {
  .login-page { grid-template-columns: 1fr 460px; }
  .visual-panel { padding: 38px; }
  .feature-row { grid-template-columns: 1fr; max-width: 400px; }
  .feature-item { display: flex; align-items: center; gap: 11px; }
  .feature-icon { margin-bottom: 0; flex-shrink: 0; }
}
@media (max-width: 850px) {
  .login-page { display: block; }
  .visual-panel { display: none; }
  .form-panel { min-height: 100vh; padding: 35px 22px; background: linear-gradient(180deg, #f7faff 0%, #ffffff 32%); }
  .form-panel::before { width: 210px; height: 210px; top: -130px; right: -90px; }
  .login-wrapper { max-width: 430px; }
  .mobile-brand { display: flex; }
}
@media (max-width: 500px) {
  .form-panel { align-items: flex-start; padding: max(24px, env(safe-area-inset-top)) 17px 30px; }
  .mobile-brand { margin-bottom: 35px; }
  .form-header { margin-bottom: 24px; }
  .form-header h2 { font-size: 23px; }
  .form-header p { font-size: 10px; }
  .role-info { margin-bottom: 18px; }
  .input-wrapper { height: 51px; }
  .login-button { height: 52px; }
  .toast-container { top: 12px; right: 15px; left: 15px; }
  .toast { width: 100%; }
}
@media (max-width: 360px) {
  .form-options { align-items: flex-start; flex-direction: column; gap: 11px; }
}