/* ==========================================================================
   MAVIDENTA DENTAL CRM — LOGIN PAGE STYLESHEET
   ========================================================================== */

@import url('design_system.css');

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: var(--font-jakarta), 'Plus Jakarta Sans', sans-serif !important;
}

:root {
  --bg-deep: #080a12;
  --bg-card: #0d0f1a;
  --accent-primary: #6366f1;
  --accent-primary-glow: rgba(99, 102, 241, 0.35);
  --accent-secondary: #a5b4fc;
  --text-primary: #f0f2ff;
  --text-secondary: #8892aa;
  --text-muted: #4a5268;
  --border-subtle: rgba(255,255,255,0.07);
  --border-focus: rgba(99, 102, 241, 0.6);
  --danger: #ff4757;
}

html, body {
  min-height: 100vh;
  font-family: var(--font-jakarta);
  background: var(--bg-deep);
  color: var(--text-primary);
  line-height: 1.6;
}

.login-bg {
  position: fixed; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 20% 50%, rgba(99,102,241,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 30%, rgba(56,189,248,0.08) 0%, transparent 50%), #080a12;
  z-index: 0;
}

.login-grid-overlay {
  position: fixed; inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  z-index: 0;
  pointer-events: none;
}

.login-container {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

@media (max-width: 900px) {
  .login-container { grid-template-columns: 1fr; }
  .login-brand { display: none; }
}

.login-brand {
  padding: 36px 60px 40px; display: flex; flex-direction: column; justify-content: flex-start;
  border-right: 1px solid var(--border-subtle);
  background: rgba(255,255,255,0.01);
}

.brand-logo { display: flex; align-items: center; gap: 14px; margin-bottom: 40px; }
.brand-logo-icon { width: 44px; height: 44px; background: linear-gradient(135deg, #6366f1, #38bdf8); border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: bold; color: #fff; box-shadow: 0 4px 20px rgba(99,102,241,0.4); }
.brand-name { font-size: 24px; font-weight: 800; color: #fff; letter-spacing: -0.5px; }
.brand-tag { font-size: 11px; font-weight: 600; color: var(--accent-secondary); text-transform: uppercase; letter-spacing: 1.5px; }

.brand-headline { font-size: 38px; font-weight: 800; color: #fff; line-height: 1.15; letter-spacing: -1px; margin-bottom: 16px; }
.brand-sub { font-size: 15px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 40px; max-width: 440px; }

.brand-stats { display: flex; flex-direction: column; gap: 16px; }
.brand-stat { display: flex; align-items: flex-start; gap: 14px; }
.brand-stat-icon { width: 36px; height: 36px; background: rgba(99,102,241,0.12); border: 1px solid rgba(99,102,241,0.25); border-radius: 9px; display: flex; align-items: center; justify-content: center; font-size: 16px; flex-shrink: 0; }
.brand-stat-text { font-size: 13px; color: var(--text-secondary); line-height: 1.4; }
.brand-stat-text strong { display: block; color: var(--text-primary); font-size: 13px; font-weight: 600; margin-bottom: 2px; }

/* Form Panel */
.login-form-panel { padding: 60px; display: flex; align-items: center; justify-content: center; }
.login-card { width: 100%; max-width: 420px; }
.login-card-header { margin-bottom: 32px; }
.login-card-title { font-size: 28px; font-weight: 800; color: #fff; margin-bottom: 6px; letter-spacing: -0.5px; }
.login-card-sub { font-size: 14px; color: var(--text-secondary); }

.login-error { display: none; background: rgba(255,71,87,0.1); border: 1px solid rgba(255,71,87,0.3); border-radius: 8px; padding: 12px 16px; font-size: 13px; color: #ff6b81; margin-bottom: 20px; align-items: center; gap: 10px; }
.login-error.visible { display: flex; }

.form-group { margin-bottom: 20px; }
.form-label { display: block; font-size: 12px; font-weight: 700; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 8px; }
.form-input-wrapper { position: relative; display: flex; align-items: center; }
.form-input { width: 100%; height: 46px; background: rgba(255,255,255,0.03); border: 1px solid var(--border-subtle); border-radius: 10px; padding: 0 16px; font-size: 14px; color: #fff; transition: all 0.2s; outline: none; }
.form-input:focus { border-color: var(--accent-primary); background: rgba(99,102,241,0.06); box-shadow: 0 0 0 3px rgba(99,102,241,0.2); }
.form-input-icon { position: absolute; right: 14px; color: var(--text-secondary); cursor: pointer; display: flex; align-items: center; justify-content: center; }

.form-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; font-size: 13px; }
.remember-me { display: flex; align-items: center; gap: 8px; color: var(--text-secondary); cursor: pointer; }
.remember-me input { accent-color: var(--accent-primary); }
.forgot-link { color: var(--accent-secondary) !important; text-decoration: none !important; font-weight: 600; }
.forgot-link:hover { color: #ffffff !important; }

/* Main Sign In Button */
.btn-login {
  width: 100%;
  height: 48px;
  background: linear-gradient(135deg, #6366f1, #38bdf8);
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 800;
  color: #ffffff !important;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 4px 20px rgba(99,102,241,0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.btn-login:hover {
  opacity: 0.95;
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(99,102,241,0.5);
}

/* Demo Accounts Section */
.login-divider {
  margin: 32px 0 20px 0;
  text-align: center;
  position: relative;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}
.login-divider::before, .login-divider::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 30%;
  height: 1px;
  background: var(--border-subtle);
}
.login-divider::before { left: 0; }
.login-divider::after { right: 0; }

.demo-accounts {
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 16px;
}
.demo-accounts-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 12px;
  text-align: center;
}
.demo-account-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(255,255,255,0.02);
  border: 1px solid transparent;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.2s;
}
.demo-account-row:last-child { margin-bottom: 0; }
.demo-account-row:hover {
  background: rgba(99,102,241,0.1);
  border-color: rgba(99,102,241,0.3);
  transform: translateX(4px);
}
.demo-account-role {
  display: flex;
  align-items: center;
  gap: 8px;
}
.role-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
}
.demo-account-name {
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
}
.demo-account-email {
  font-size: 12px;
  color: var(--accent-secondary);
  font-family: monospace !important;
}

/* Footer Links */
.login-footer {
  margin-top: 32px;
  text-align: center;
  font-size: 12.5px;
  color: var(--text-muted);
}
.login-footer a {
  color: var(--accent-secondary) !important;
  text-decoration: none !important;
  font-weight: 600;
  transition: color 0.2s;
}
.login-footer a:hover {
  color: #ffffff !important;
}

/* Modal Popup */
.modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(8,10,18,0.85);
  backdrop-filter: blur(12px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
}
.modal-backdrop.hidden { display: none; }
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-glow);
  border-radius: 16px;
  padding: 28px;
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-lg);
}
.modal-title { font-size: 18px; font-weight: 800; color: #fff; margin-bottom: 14px; }
.modal-body { font-size: 14px; color: var(--text-secondary); line-height: 1.6; margin-bottom: 20px; }
.modal-close {
  width: 100%; padding: 12px; background: rgba(255,255,255,0.08); border: 1px solid var(--border-subtle);
  border-radius: 8px; color: #fff; font-weight: 700; cursor: pointer; transition: all 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.15); }
