:root {
  --primary: #38bdf8; --primary-dark: #0ea5e9; --primary-darker: #0284c7;
  --primary-light: #7dd3fc; --primary-soft: #e0f2fe;
  --primary-glow: rgba(56,189,248,0.4);
  --success: #10b981; --danger: #ef4444; --warning: #f59e0b;
  --gray-900: #0f172a; --gray-700: #334155; --gray-500: #64748b;
  --gray-400: #94a3b8; --gray-300: #cbd5e1; --gray-200: #e2e8f0; --gray-100: #f1f5f9;
  --gray-50: #f8fafc; --white: #ffffff;
  --border: #e2e8f0;
  --radius: 12px; --radius-sm: 8px; --radius-lg: 16px;
  --shadow-xl: 0 25px 50px -12px rgba(15,23,42,0.25);
  --transition: all 0.22s cubic-bezier(0.4,0,0.2,1);
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body {
  font-family: 'Roboto Condensed', system-ui, -apple-system, 'Segoe UI', Roboto, Arial, sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
  font-size: 14.5px;
  -webkit-font-smoothing: antialiased;
  color: var(--gray-900);
  background: #0c4a6e;
}
.bi {
  display: inline-flex; align-items: center; justify-content: center;
  line-height: 1; vertical-align: -0.125em; flex-shrink: 0;
}

/* ============ BACKGROUND ============ */
.login-bg {
  position: fixed; inset: 0;
  background: url('assets/login-bg.jpg') center center / cover no-repeat;
  overflow: hidden; z-index: 0;
}
.login-bg::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(8,47,73,0.20) 0%, rgba(8,47,73,0.38) 100%);
}
.login-shape { display: none; }
.shape-1 {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #38bdf8, transparent 70%);
  top: -200px; left: -200px;
  animation-delay: 0s;
}
.shape-2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, #0ea5e9, transparent 70%);
  bottom: -300px; right: -200px;
  animation-delay: -7s;
}
.shape-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, #06b6d4, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation-delay: -14s;
  opacity: 0.2;
}
@keyframes floatShape {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33% { transform: translate(40px, -40px) scale(1.1); }
  66% { transform: translate(-30px, 30px) scale(0.95); }
}

/* ============ CONTAINER ============ */
.login-container {
  position: relative; z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 30px;
  gap: 30px;
  max-width: 1300px;
  margin: 0 auto;
  align-items: center;
}

/* ============ BRAND PANEL (LEFT) ============ */
.login-brand {
  color: white;
  padding: 44px;
  display: flex; flex-direction: column;
  justify-content: space-between;
  min-height: 600px;
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: rgba(8,47,73,0.58);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.14);
  box-shadow: var(--shadow-xl);
}
.brand-content { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; padding-bottom: 10px; }
.brand-logo-lg {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, #38bdf8, #0ea5e9);
  border-radius: 20px;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; color: white;
  box-shadow: 0 20px 40px -10px rgba(56,189,248,0.6);
  margin-bottom: 28px;
  animation: logoFloat 3s ease-in-out infinite;
}
@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}
.brand-title {
  font-size: 48px; font-weight: 800;
  letter-spacing: -1px;
  line-height: 1.1;
  margin-bottom: 10px;
}
.brand-title span { color: #7dd3fc; }
.brand-tagline {
  font-size: 14px;
  color: rgba(186,230,253,0.75);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  margin-bottom: 24px;
}
.brand-desc {
  font-size: 15px;
  color: rgba(255,255,255,0.75);
  line-height: 1.7;
  margin-bottom: 36px;
  max-width: 420px;
}
.brand-features {
  display: flex; flex-direction: column; gap: 14px;
}
.feature-item {
  display: flex; align-items: center; gap: 12px;
  font-size: 14px;
  color: rgba(255,255,255,0.85);
}
.feature-item .bi {
  color: #10b981;
  font-size: 18px;
  flex-shrink: 0;
}
.brand-footer {
  display: flex; justify-content: space-between;
  font-size: 12px;
  color: rgba(186,230,253,0.5);
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
}

/* ============ FORM PANEL (RIGHT) ============ */
.login-form-panel {
  display: flex; align-items: center; justify-content: center;
}
.login-form-wrapper {
  width: 100%;
  max-width: 420px;
  background: rgba(255,255,255,0.98);
  backdrop-filter: blur(20px);
  border-radius: var(--radius-lg);
  padding: 40px 36px;
  box-shadow: var(--shadow-xl);
  border: 1px solid rgba(255,255,255,0.3);
  animation: formSlide 0.5s cubic-bezier(0.16,1,0.3,1);
}
@keyframes formSlide {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.form-header {
  text-align: center;
  margin-bottom: 30px;
}
.form-icon {
  width: 56px; height: 56px;
  background: linear-gradient(135deg, var(--primary-soft), rgba(56,189,248,0.15));
  border-radius: 16px;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 26px;
  color: var(--primary-dark);
  margin-bottom: 16px;
}
.form-title {
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-900);
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}
.form-subtitle {
  font-size: 13.5px;
  color: var(--gray-500);
}

/* FORM */
.form-group {
  margin-bottom: 18px;
}
.form-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--gray-700);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.input-wrap {
  position: relative;
  display: flex; align-items: center;
}
.input-wrap > .bi:first-child {
  position: absolute;
  left: 14px;
  color: var(--gray-400);
  font-size: 16px;
  pointer-events: none;
  transition: var(--transition);
}
.form-input {
  width: 100%;
  padding: 13px 44px 13px 44px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--gray-50);
  color: var(--gray-900);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  transition: var(--transition);
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--white);
  box-shadow: 0 0 0 4px var(--primary-glow);
}
.input-wrap:focus-within > .bi:first-child {
  color: var(--primary-dark);
}
.form-input::placeholder {
  color: var(--gray-400);
  font-weight: 400;
}
.toggle-password {
  position: absolute;
  right: 8px;
  background: none;
  border: none;
  width: 32px; height: 32px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  color: var(--gray-400);
  font-size: 16px;
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
}
.toggle-password:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}

/* CHECKBOX */
.form-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.checkbox-wrap {
  display: inline-flex; align-items: center; gap: 10px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--gray-700);
  font-weight: 500;
}
.checkbox-wrap input {
  position: absolute; opacity: 0; pointer-events: none;
}
.checkbox-custom {
  width: 18px; height: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 4px;
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  transition: var(--transition);
  position: relative;
  flex-shrink: 0;
}
.checkbox-custom::after {
  content: '';
  width: 5px; height: 9px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0);
  transition: var(--transition);
  margin-top: -2px;
}
.checkbox-wrap input:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}
.checkbox-wrap input:checked + .checkbox-custom::after {
  transform: rotate(45deg) scale(1);
}
.checkbox-label { line-height: 1; }

/* ERROR */
.login-error {
  display: none;
  padding: 12px 14px;
  background: #fee2e2;
  border: 1px solid rgba(239,68,68,0.3);
  border-left: 4px solid var(--danger);
  border-radius: var(--radius-sm);
  color: #b91c1c;
  font-size: 13px;
  margin-bottom: 16px;
  align-items: center;
  gap: 10px;
  animation: shakeError 0.4s ease;
}
.login-error.show { display: flex; }
.login-error .bi { font-size: 18px; flex-shrink: 0; }
@keyframes shakeError {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-6px); }
  75% { transform: translateX(6px); }
}

/* BUTTON */
.btn-login {
  width: 100%;
  padding: 14px 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  border-radius: var(--radius-sm);
  color: white;
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 10px;
  transition: var(--transition);
  box-shadow: 0 10px 25px -5px rgba(56,189,248,0.5);
  letter-spacing: 0.3px;
  position: relative;
  overflow: hidden;
}
.btn-login:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px -5px rgba(56,189,248,0.6);
}
.btn-login:active:not(:disabled) {
  transform: translateY(0);
}
.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}
.btn-login.loading .btn-text { opacity: 0; }
.btn-login.loading::before {
  content: '';
  position: absolute;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.btn-login.loading > .bi { opacity: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* HINT */
.login-hint {
  margin-top: 24px;
  padding: 14px;
  background: linear-gradient(135deg, var(--primary-soft), rgba(56,189,248,0.08));
  border: 1px solid rgba(56,189,248,0.25);
  border-radius: var(--radius-sm);
  display: flex; gap: 12px;
  font-size: 12px;
  color: var(--gray-700);
  line-height: 1.5;
}
.login-hint > .bi {
  color: var(--primary-dark);
  font-size: 18px;
  flex-shrink: 0;
}
.login-hint strong { color: var(--gray-900); }
.login-hint code {
  background: white;
  padding: 1px 6px;
  border-radius: 4px;
  font-family: 'Courier New', monospace;
  font-size: 11.5px;
  color: var(--primary-darker);
  border: 1px solid var(--border);
}
.hint-sub {
  color: var(--gray-500);
  font-size: 11px;
}

/* FOOTER */
.form-footer {
  text-align: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  color: var(--gray-500);
}

/* TOAST */
.toast-container {
  position: fixed; top: 20px; right: 20px; z-index: 3000;
  display: flex; flex-direction: column; gap: 10px; max-width: 380px;
}
.toast {
  padding: 13px 16px; border-radius: var(--radius-sm);
  background: white; box-shadow: var(--shadow-xl);
  display: flex; align-items: center; gap: 12px;
  border: 1px solid var(--border); border-left: 4px solid var(--primary);
  animation: slideInRight 0.3s cubic-bezier(0.16,1,0.3,1);
  min-width: 280px;
  font-size: 13px;
}
@keyframes slideInRight {
  from { transform: translateX(120%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
.toast.removing { animation: slideOutRight 0.3s forwards; }
@keyframes slideOutRight { to { transform: translateX(120%); opacity: 0; } }
.toast-icon {
  width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: white; flex-shrink: 0;
}
.toast.success { border-left-color: var(--success); }
.toast.success .toast-icon { background: var(--success); }
.toast.error { border-left-color: var(--danger); }
.toast.error .toast-icon { background: var(--danger); }
.toast.warning { border-left-color: var(--warning); }
.toast.warning .toast-icon { background: var(--warning); }
.toast.info { border-left-color: var(--primary); }
.toast.info .toast-icon { background: var(--primary); }
.toast-content { flex: 1; }
.toast-title { font-weight: 700; color: var(--gray-900); margin-bottom: 2px; }
.toast-message { font-size: 12px; color: var(--gray-500); }

/* ============ RESPONSIVE ============ */
@media (max-width: 968px) {
  .login-container {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 0;
  }
  .login-brand { display: none; }
  .login-form-panel { min-height: calc(100vh - 40px); }
}
@media (max-width: 480px) {
  .login-container { padding: 12px; }
  .login-form-wrapper { padding: 30px 22px; border-radius: var(--radius); }
  .form-title { font-size: 20px; }
  .form-icon { width: 48px; height: 48px; font-size: 22px; }
}

/* ============ MODAL OVERLAY (untuk forgot password) ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.show { display: flex; animation: fadeIn 0.2s ease; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: #fff;
  border-radius: 16px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 25px 50px -12px rgba(15,23,42,0.25);
  animation: modalSlide 0.3s cubic-bezier(0.16,1,0.3,1);
  border: 1px solid #e2e8f0;
}
@keyframes modalSlide {
  from { opacity: 0; transform: translateY(20px) scale(0.96); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.modal-header {
  padding: 18px 22px;
  border-bottom: 1px solid #e2e8f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #f1f5f9;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: #64748b;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}
.modal-close:hover { background: #ef4444; color: #fff; }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  padding: 14px 22px;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}
/* ============ TOAST CLOSE BUTTON ============ */
.toast-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--gray-400);
  font-size: 14px;
  padding: 3px 5px;
  border-radius: 4px;
  line-height: 1;
  transition: var(--transition);
}
.toast-close:hover {
  background: var(--gray-100);
  color: var(--gray-700);
}
/* Tombol generik untuk footer modal (lupa password) */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 18px; border-radius: 8px; border: none;
  font-family: inherit; font-size: 13.5px; font-weight: 700;
  cursor: pointer; text-decoration: none; line-height: 1.3;
}
.btn-secondary {
  background: #f1f5f9; color: #334155; border: 1px solid #e2e8f0;
}
.btn-secondary:hover { background: #e2e8f0; }