/* =========================================
   Login Page Stylesheet
   Theme Color: Navy Blue (HMS-style)
   ========================================= */

:root {
  --dark: #1e3a8a;
  --dark-2: #162d6e;
  --dark-3: #112259;
  --accent: #2548aa;
  --accent-hover: #162d6e;
  --text-muted: #94a3b8;
  --border: #e2e8f0;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  min-height: 100vh;
  display: flex;
  background: var(--dark);
  overflow: hidden;
}

/* ============================================================
   LAYOUT – Split Panel
   ============================================================ */
.login-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* Left decorative panel */
.login-panel-left {
  flex: 1.2;
  background: var(--dark);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  position: relative;
  overflow: hidden;
}

/* Decorative circles */
.login-panel-left::before {
  content: '';
  position: absolute;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  background: rgba(255,255,255,0.05);
  top: -120px;
  right: -120px;
  pointer-events: none;
}
.login-panel-left::after {
  content: '';
  position: absolute;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: rgba(255,255,255,0.04);
  bottom: -80px;
  left: -80px;
  pointer-events: none;
}

.left-content { position: relative; z-index: 1; text-align: center; max-width: 440px; }

.brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 56px;
}

.brand-logo .icon-wrap {
  width: 48px;
  height: 48px;
  background: var(--accent);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.brand-logo .icon-wrap i { color: #fff; font-size: 22px; }
.brand-logo .brand-name { font-size: 22px; font-weight: 800; color: #fff; letter-spacing: 0.5px; }

/* Illustration */
.illustration {
  width: 100%;
  max-width: 340px;
  margin: 0 auto 48px;
}

/* Fake dashboard preview card */
.preview-card {
  background: var(--dark-2);
  border-radius: 16px;
  padding: 18px;
  border: 1px solid rgba(255,255,255,0.07);
  text-align: left;
}

.preview-card .pc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
.preview-card .pc-title { font-size: 12px; font-weight: 700; color: rgba(255,255,255,0.7); }
.preview-card .pc-dots { display: flex; gap: 5px; }
.preview-card .pc-dots span {
  width: 8px; height: 8px; border-radius: 50%;
}
.pc-dots .d1 { background: #e74a3b; }
.pc-dots .d2 { background: #f6c23e; }
.pc-dots .d3 { background: #1cc88a; }

.pc-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.pc-stat {
  background: rgba(255,255,255,0.04);
  border-radius: 10px;
  padding: 10px;
  border: 1px solid rgba(255,255,255,0.05);
}
.pc-stat-val { font-size: 16px; font-weight: 800; color: #fff; }
.pc-stat-label { font-size: 9px; color: rgba(255,255,255,0.4); margin-top: 2px; }

.pc-bars { display: flex; align-items: flex-end; gap: 5px; height: 54px; }
.pc-bar {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: rgba(255,255,255,0.2);
}
.pc-bar.hi { background: rgba(255,255,255,0.6); }

.left-tagline {
  font-size: 26px;
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  margin-bottom: 14px;
}
.left-tagline span { color: var(--accent); }

.left-sub {
  font-size: 14px;
  color: rgba(255,255,255,0.45);
  line-height: 1.7;
}

/* Right form panel */
.login-panel-right {
  flex: 1;
  background: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 48px;
  min-width: 420px;
}

.login-form-wrap { width: 100%; max-width: 380px; }

.form-header { margin-bottom: 36px; }
.form-header h2 { font-size: 26px; font-weight: 800; color: #1e293b; margin: 0 0 6px; }
.form-header p  { font-size: 14px; color: #adb5bd; margin: 0; }

/* Form elements */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: #495057;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  margin-bottom: 7px;
}

.input-wrap { position: relative; }

.input-wrap .input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: #adb5bd;
  font-size: 15px;
  pointer-events: none;
}

.form-input {
  width: 100%;
  height: 46px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  padding: 0 14px 0 40px;
  font-size: 14px;
  color: #1e293b;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s;
  background: #fff;
}
.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(30,58,138,0.18);
}
.form-input.error { border-color: #e74a3b; }

.toggle-password {
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: #adb5bd;
  font-size: 15px;
  padding: 0;
  transition: color 0.15s;
}
.toggle-password:hover { color: #495057; }

.form-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
}

.remember-me {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: #495057;
  user-select: none;
}

.remember-me input { display: none; }

.custom-checkbox {
  width: 18px;
  height: 18px;
  border: 2px solid #ced4da;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s;
  flex-shrink: 0;
}
.remember-me input:checked + .custom-checkbox {
  background: var(--accent);
  border-color: var(--accent);
}
.custom-checkbox::after {
  content: '✓';
  font-size: 11px;
  color: transparent;
  font-weight: 700;
  line-height: 1;
}
.remember-me input:checked + .custom-checkbox::after { color: #fff; }

.forgot-link { font-size: 13px; color: var(--accent); font-weight: 600; }
.forgot-link:hover { color: var(--accent-hover); }

/* Submit button */
.btn-login {
  width: 100%;
  height: 48px;
  background: var(--dark);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: 0.3px;
}
.btn-login:hover { background: var(--dark-3); }
.btn-login:active { transform: scale(0.985); }

.btn-login .spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.65s linear infinite;
  display: none;
}
.btn-login.loading .spinner { display: block; }
.btn-login.loading .btn-text { display: none; }

@keyframes spin { to { transform: rotate(360deg); } }

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 24px 0;
  color: #ced4da;
  font-size: 12px;
}
.divider::before, .divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Social buttons */
.social-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.social-btn {
  height: 44px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: #495057;
  cursor: pointer;
  background: #fff;
  transition: border-color 0.18s, background 0.18s;
}
.social-btn:hover { border-color: #adb5bd; background: #f8f9fa; }
.social-btn img { width: 18px; height: 18px; }

/* Alert */
.alert {
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 13px;
  margin-bottom: 20px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  display: none;
}
.alert.show { display: flex; }
.alert-danger  { background: #fdecea; color: #c0392b; border: 1px solid #f5c6c4; }
.alert-success { background: #d4f5e9; color: #0e7c59; border: 1px solid #a8e6cf; }
.alert i { font-size: 15px; flex-shrink: 0; margin-top: 1px; }

.signup-link {
  text-align: center;
  margin-top: 28px;
  font-size: 13px;
  color: #adb5bd;
}
.signup-link a { color: var(--accent); font-weight: 600; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
  .login-panel-left { display: none; }
  .login-panel-right { min-width: 100%; padding: 48px 24px; }
}

@media (max-width: 480px) {
  .login-panel-right { padding: 40px 20px; }
  .social-btns { grid-template-columns: 1fr; }
}
