/* login.css */
:root {
  --primary: #0066cc;
  --secondary: #004080;
  --accent: #00b894;
  --bg: #f8fafc;
  --text: #1e293b;
  --text-light: #475569;
  --white: #ffffff;
  --card-bg: #ffffff;
  --border: #e2e8f0;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.1);
  --danger: #ef4444;
  --warning: #f59e0b;
  --success: #00b894;
  --superadmin-color: #f59e0b;
  --transition: all 0.3s ease;
  --visual-bg: url('https://images.unsplash.com/photo-1454165804606-c3d57bc86b40?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80');
}

body.dark-mode {
  --bg: #0f172a;
  --text: #f1f5f9;
  --text-light: #cbd5e1;
  --white: #1e293b;
  --card-bg: #1e293b;
  --border: #334155;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  --shadow-lg: 0 15px 40px rgba(0, 0, 0, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Poppins', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  transition: background 0.3s ease, color 0.3s ease;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.modal-overlay {
  display: none; position: fixed; top: 0; left: 0;
  width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6);
  z-index: 3000; align-items: center; justify-content: center;
}
.modal-overlay.active { display: flex; }
.modal {
  background: var(--card-bg); border-radius: 20px; padding: 30px;
  width: 90%; max-width: 460px; box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  border: 1px solid var(--border); text-align: center;
  animation: modalSlideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(-20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }
.modal-icon { font-size: 3.5rem; margin-bottom: 15px; }
.modal-icon.warning { color: #f59e0b; }
.modal-icon.danger { color: #ef4444; }
.modal h2 { font-size: 1.25rem; font-weight: 600; margin-bottom: 12px; color: var(--text); }
.modal p { color: var(--text-light); font-size: 0.9rem; line-height: 1.6; margin-bottom: 20px; }
.modal .btn { margin: 5px; }

.top-bar { background: var(--card-bg); box-shadow: var(--shadow); position: sticky; top: 0; z-index: 50; padding: 0 20px; }
.top-bar-container { display: flex; align-items: center; justify-content: space-between; max-width: 1200px; margin: 0 auto; height: 60px; }
.top-logo { display: flex; align-items: center; gap: 10px; font-size: 1.4rem; font-weight: 700; color: var(--primary); text-decoration: none; }
.top-logo i { font-size: 1.8rem; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { background: none; border: none; color: var(--text); font-size: 1.1rem; cursor: pointer; padding: 8px 10px; border-radius: 8px; display: flex; align-items: center; gap: 5px; transition: var(--transition); }
.icon-btn:hover { background: rgba(0, 0, 0, 0.05); }
body.dark-mode .icon-btn:hover { background: rgba(255, 255, 255, 0.05); }
.lang-text { font-size: 0.7rem; font-weight: 700; }
.back-home-link { display: flex; align-items: center; gap: 6px; color: var(--text); text-decoration: none; font-size: 0.9rem; font-weight: 500; padding: 8px 14px; border-radius: 8px; transition: var(--transition); }
.back-home-link:hover { background: rgba(0, 0, 0, 0.05); color: var(--primary); }

.login-main { flex: 1; display: flex; align-items: center; justify-content: center; padding: 30px 20px; }
.login-container { display: flex; width: 100%; max-width: 1000px; min-height: 600px; background: var(--card-bg); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow-lg); border: 1px solid var(--border); }

.login-visual { flex: 1; position: relative; background: var(--visual-bg) no-repeat center center/cover; display: flex; align-items: center; justify-content: center; padding: 40px; min-height: 500px; }
.visual-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: linear-gradient(135deg, rgba(0, 64, 128, 0.9), rgba(0, 102, 204, 0.85)); }
.visual-content { position: relative; z-index: 1; color: #fff; text-align: center; max-width: 400px; }
.visual-logo { font-size: 4rem; margin-bottom: 20px; }
.visual-content h1 { font-size: 1.8rem; margin-bottom: 15px; line-height: 1.3; font-weight: 700; }
.visual-subtitle { font-size: 1rem; opacity: 0.9; margin-bottom: 30px; line-height: 1.6; }
.visual-features { display: flex; flex-direction: column; gap: 12px; }
.visual-feature { display: flex; align-items: center; gap: 10px; background: rgba(255, 255, 255, 0.15); padding: 10px 16px; border-radius: 10px; backdrop-filter: blur(5px); font-size: 0.9rem; }
.visual-feature i { font-size: 1.2rem; }

.login-form-panel { flex: 1; display: flex; align-items: center; justify-content: center; padding: 40px 35px; }
.form-wrapper { width: 100%; max-width: 400px; }
.form-step { display: none; animation: fadeSlideIn 0.5s ease; }
.form-step.active { display: block; }
@keyframes fadeSlideIn { from { opacity: 0; transform: translateY(15px); } to { opacity: 1; transform: translateY(0); } }

.form-header { text-align: center; margin-bottom: 25px; }
.form-logo-mobile { display: none; font-size: 2.5rem; color: var(--primary); margin-bottom: 10px; }
.form-header h2 { font-size: 1.6rem; margin-bottom: 5px; color: var(--text); }
.form-header p { color: var(--text-light); font-size: 0.9rem; }

.role-tabs { display: flex; background: var(--bg); border-radius: 10px; padding: 4px; margin-bottom: 25px; border: 1px solid var(--border); flex-wrap: wrap; }
.role-tab { flex: 1; padding: 10px 8px; border: none; background: transparent; color: var(--text-light); font-family: 'Poppins', sans-serif; font-weight: 500; font-size: 0.85rem; cursor: pointer; border-radius: 8px; transition: var(--transition); display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 90px; }
.role-tab.active { background: var(--primary); color: #fff; box-shadow: 0 2px 8px rgba(0, 102, 204, 0.3); }
.role-tab[data-role="super_admin"].active { background: linear-gradient(135deg, #f59e0b, #d97706); box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4); }
.role-tab:hover:not(.active) { color: var(--primary); }
.role-tab[data-role="super_admin"]:hover:not(.active) { color: #f59e0b; }

.input-group { margin-bottom: 18px; }
.input-group label { display: block; font-weight: 600; margin-bottom: 6px; font-size: 0.88rem; color: var(--text); }
.input-wrapper { display: flex; align-items: center; background: var(--bg); border: 2px solid var(--border); border-radius: 10px; padding: 0 14px; transition: var(--transition); }
.input-wrapper:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.08); }
.input-wrapper i { color: var(--text-light); margin-right: 10px; font-size: 0.95rem; }
.input-wrapper input { width: 100%; border: none; outline: none; padding: 14px 0; font-family: 'Poppins', sans-serif; font-size: 0.95rem; background: transparent; color: var(--text); }
.input-wrapper input::placeholder { color: #94a3b8; }
.toggle-password { background: none; border: none; color: var(--text-light); cursor: pointer; padding: 6px; transition: var(--transition); }
.toggle-password:hover { color: var(--primary); }
.error-message { color: var(--danger); font-size: 0.78rem; margin-top: 4px; display: block; min-height: 18px; }

.form-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 22px; flex-wrap: wrap; gap: 8px; }
.remember-me { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 0.85rem; color: var(--text-light); }
.remember-me input[type="checkbox"] { accent-color: var(--primary); width: 16px; height: 16px; cursor: pointer; }
.forgot-password { color: var(--primary); font-size: 0.85rem; font-weight: 500; text-decoration: none; cursor: pointer; }
.forgot-password:hover { text-decoration: underline; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 24px; border-radius: 10px; font-weight: 600; font-size: 0.95rem; cursor: pointer; border: 2px solid transparent; transition: var(--transition); font-family: 'Poppins', sans-serif; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--secondary); border-color: var(--secondary); transform: translateY(-1px); box-shadow: 0 5px 18px rgba(0, 102, 204, 0.35); }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-warning:hover { background: #d97706; border-color: #d97706; }
.btn-full { width: 100%; }
.btn-loader { display: flex; align-items: center; gap: 6px; }

.demo-hint { margin-top: 20px; text-align: center; padding: 12px; background: #eff6ff; border-radius: 8px; font-size: 0.78rem; color: #1e40af; border: 1px dashed #93c5fd; line-height: 1.6; }
body.dark-mode .demo-hint { background: #1e3a5f; color: #93c5fd; border-color: #3b82f6; }
.demo-hint i { margin-right: 4px; }
.demo-hint p { margin: 2px 0; }

.otp-icon { font-size: 3rem; color: var(--primary); margin-bottom: 10px; }
.otp-email-display { color: var(--primary); font-weight: 600; font-size: 0.9rem; margin-top: 8px; }
.otp-inputs-container { display: flex; gap: 10px; justify-content: center; margin-bottom: 8px; }
.otp-input { width: 48px; height: 55px; text-align: center; font-size: 1.4rem; font-weight: 700; font-family: 'Poppins', sans-serif; border: 2px solid var(--border); border-radius: 10px; background: var(--bg); color: var(--text); transition: var(--transition); }
.otp-input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0, 102, 204, 0.1); }
.otp-timer { text-align: center; margin: 15px 0; font-size: 0.9rem; color: var(--text-light); display: flex; align-items: center; justify-content: center; gap: 6px; }
.otp-timer.expired { color: var(--danger); }
.otp-actions { display: flex; justify-content: space-between; margin-top: 20px; }
.text-btn { background: none; border: none; color: var(--primary); cursor: pointer; font-family: 'Poppins', sans-serif; font-size: 0.85rem; font-weight: 500; display: flex; align-items: center; gap: 5px; transition: var(--transition); }
.text-btn:hover { color: var(--secondary); }
.text-btn:disabled { color: var(--text-light); cursor: not-allowed; opacity: 0.6; }

.success-content { text-align: center; padding: 30px 0; }
.success-icon { font-size: 5rem; color: var(--success); margin-bottom: 20px; animation: scaleIn 0.5s ease; }
@keyframes scaleIn { from { transform: scale(0); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.success-content h2 { margin-bottom: 10px; color: var(--success); }
.success-content p { color: var(--text-light); margin-bottom: 25px; }
.redirect-loader { font-size: 2rem; color: var(--primary); }

.toast-container { position: fixed; top: 20px; right: 20px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; max-width: 380px; }
.toast { padding: 15px 20px; border-radius: 12px; color: #fff; font-size: 0.9rem; display: flex; align-items: center; gap: 10px; box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2); animation: slideInRight 0.4s ease, fadeOut 0.4s ease 3.5s forwards; font-family: 'Poppins', sans-serif; }
.toast i { font-size: 1.2rem; }
.toast-success { background: #059669; }
.toast-error { background: #dc2626; }
.toast-info { background: #2563eb; }
.toast-warning { background: #d97706; }
@keyframes slideInRight { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
@keyframes fadeOut { from { opacity: 1; } to { opacity: 0; transform: translateY(-10px); } }

.login-features { padding: 60px 20px; background: var(--bg); }
.container { max-width: 1100px; margin: 0 auto; }
.features-title { text-align: center; font-size: 1.6rem; margin-bottom: 35px; color: var(--text); }
.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 22px; }
.feature-card { background: var(--card-bg); padding: 28px 22px; border-radius: 14px; box-shadow: var(--shadow); text-align: center; border: 1px solid var(--border); transition: var(--transition); }
.feature-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lg); }
.feature-card i { font-size: 2.2rem; color: var(--primary); margin-bottom: 14px; }
.feature-card h3 { font-size: 1.05rem; margin-bottom: 8px; }
.feature-card p { color: var(--text-light); font-size: 0.88rem; line-height: 1.5; }

.login-footer { background: #0f172a; color: #cbd5e1; text-align: center; padding: 25px 20px; }
.footer-logo { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 1.3rem; color: #fff; margin-bottom: 6px; }
.footer-logo i { color: #3399ff; }
.footer-contact { margin-top: 6px; font-size: 0.85rem; }
.footer-contact .separator { margin: 0 8px; }

@media (max-width: 768px) {
  .login-container { flex-direction: column; max-width: 480px; min-height: auto; }
  .login-visual { display: none; }
  .login-form-panel { padding: 30px 25px; }
  .form-logo-mobile { display: block; }
  .top-bar-container { height: 55px; }
  .top-logo { font-size: 1.2rem; }
  .top-logo i { font-size: 1.5rem; }
  .back-home-link span { display: none; }
  .otp-input { width: 42px; height: 50px; font-size: 1.2rem; }
  .features-title { font-size: 1.4rem; }
  .role-tabs { flex-wrap: wrap; }
  .role-tab { font-size: 0.78rem; padding: 8px 6px; }
  .modal { width: 95%; padding: 25px; }
}
@media (max-width: 400px) {
  .login-form-panel { padding: 20px 18px; }
  .otp-inputs-container { gap: 6px; }
  .otp-input { width: 38px; height: 46px; font-size: 1.1rem; }
  .form-options { flex-direction: column; align-items: flex-start; }
  .role-tab { min-width: 80px; font-size: 0.75rem; }
}