/* =====================================================================
   DU Budget Control System — Auth / Login Page Stylesheet
   Matches the split-panel design from du_Cards (du_Cards/index.php)
   ===================================================================== */

/* Google Fonts loaded via <link> in login.php (local vendor) */

:root {
  --primary:      #003366;
  --hover:        #002244;
  --accent:       #C8960C;
  --accent-light: #F5E6B3;
  --radius:       10px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: 'Inter', 'Segoe UI', system-ui, sans-serif;
  background: #F0F2F5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: #333;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cdefs%3E%3Cpattern id='p' patternUnits='userSpaceOnUse' width='10' height='10' patternTransform='rotate(5)'%3E%3Crect x='0' y='0' width='5' height='5' fill='rgba(230,230,230,0.3)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect fill='%23f0f2f5' width='100%25' height='100%25'/%3E%3Crect fill='url(%23p)' width='100%25' height='100%25'/%3E%3C/svg%3E");
  background-attachment: fixed;
}

/* ── Page wrapper ──────────────────────────────────────────────────── */
.auth-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}
.auth-container {
  max-width: 1040px;
  width: 100%;
}
.auth-wrapper {
  display: flex;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: 0 8px 30px rgba(149,157,165,0.25);
  min-height: 560px;
  background: #fff;
}

/* ── Left panel (navy sidebar) ─────────────────────────────────────── */
.auth-sidebar {
  flex: 0 0 42%;
  background: linear-gradient(145deg, var(--primary) 0%, var(--hover) 100%);
  color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 2.5rem;
  position: relative;
  overflow: hidden;
}
/* Subtle dot pattern overlay */
.auth-sidebar::before {
  content: '';
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='100%25' height='100%25'%3E%3Cdefs%3E%3Cpattern id='p' patternUnits='userSpaceOnUse' width='12' height='12' patternTransform='rotate(45)'%3E%3Crect x='0' y='0' width='4' height='4' fill='rgba(255,255,255,0.07)'/%3E%3C/pattern%3E%3C/defs%3E%3Crect fill='transparent' width='100%25' height='100%25'/%3E%3Crect fill='url(%23p)' width='100%25' height='100%25'/%3E%3C/svg%3E");
  z-index: 0;
}
.auth-sidebar-content {
  position: relative;
  z-index: 1;
  text-align: center;
}
.sidebar-logo {
  width: 120px;
  height: auto;
  margin: 0 auto 1.5rem;
  padding: 8px 12px;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.25);
  display: block;
}
.auth-sidebar h2 {
  font-size: 1.55rem;
  font-weight: 700;
  margin-bottom: 1rem;
  line-height: 1.3;
}
.auth-sidebar h2 span { color: #C8960C; }
.auth-sidebar p {
  opacity: 0.85;
  font-size: 0.9rem;
  line-height: 1.65;
  margin-bottom: 2rem;
}
.auth-feature-list {
  list-style: none;
  text-align: left;
  margin-top: 1rem;
}
.auth-feature-list li {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  opacity: 0.9;
}
.auth-feature-list li i {
  color: #C8960C;
  font-size: 0.75rem;
  flex-shrink: 0;
}
.auth-quote {
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid rgba(255,255,255,0.15);
}
.auth-quote p { font-style: italic; font-size: 0.82rem; opacity: 0.75; }

/* ── Right panel (form) ────────────────────────────────────────────── */
.auth-form-side {
  flex: 0 0 58%;
  padding: 3rem 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.auth-login-header {
  margin-bottom: 2.5rem;
  text-align: center;
}
.auth-form-logo {
  width: 160px;
  height: auto;
  margin: 0 auto 1.5rem;
  padding: 8px;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.08);
  border: 1px solid #e8e8e8;
  transition: transform 0.3s, box-shadow 0.3s;
}
.auth-form-logo:hover {
  transform: scale(1.04);
  box-shadow: 0 6px 20px rgba(0,0,0,0.12);
}
.auth-title {
  font-size: 1.45rem;
  font-weight: 700;
  color: #1A202C;
  margin-bottom: 0.35rem;
}
.auth-subtitle {
  color: #718096;
  font-size: 0.9rem;
}

/* ── Alert styles ─────────────────────────────────────────────────── */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.875rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.5rem;
  font-size: 0.875rem;
  animation: fadeSlideIn 0.4s ease;
}
.auth-alert-error   { background: #FEE2E2; border: 1px solid #FECACA; color: #B91C1C; }
.auth-alert-info    { background: #E0F2FE; border: 1px solid #BAE6FD; color: #0369A1; }
.auth-alert-success { background: #EBF7EF; border: 1px solid #A7F3D0; color: #1E7E4E; }
@keyframes fadeSlideIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Demo login chips ────────────────────────────────────────────── */
.demo-login-panel {
  margin-bottom: 1.5rem;
  padding: 1rem;
  border: 1px solid #D9E5EF;
  border-radius: 12px;
  background: linear-gradient(135deg, #F7FAFC 0%, #EFF6FA 100%);
}
.demo-login-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: .75rem;
}
.demo-login-eyebrow {
  display: block;
  color: var(--primary);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.demo-login-eyebrow i { color: var(--accent); margin-right: .25rem; }
.demo-login-heading h2 {
  margin-top: .2rem;
  color: #1A202C;
  font-size: 1rem;
}
.demo-login-status {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .28rem .5rem;
  border-radius: 999px;
  background: #E8F5ED;
  color: #287A4B;
  font-size: .66rem;
  font-weight: 700;
  white-space: nowrap;
}
.demo-login-status i { font-size: .42rem; }
.demo-login-description {
  margin: .35rem 0 .8rem;
  color: #718096;
  font-size: .78rem;
}
.demo-login-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .55rem;
}
.demo-login-chip-form { min-width: 0; }
.demo-login-chip {
  width: 100%;
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: .55rem;
  padding: .55rem .6rem;
  border: 1px solid #D6E0E8;
  border-radius: 9px;
  background: #fff;
  color: #1A202C;
  cursor: pointer;
  text-align: left;
  transition: border-color .2s, box-shadow .2s, transform .2s;
  font-family: inherit;
}
.demo-login-chip:hover,
.demo-login-chip:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(0, 51, 102, .12);
  outline: none;
  transform: translateY(-1px);
}
.demo-login-avatar {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  flex-shrink: 0;
  border-radius: 8px;
  background: #E8EFF6;
  color: var(--primary);
  font-size: .78rem;
}
.demo-login-chip-copy { min-width: 0; flex: 1; }
.demo-login-chip-copy strong,
.demo-login-chip-copy small { display: block; overflow-wrap: anywhere; }
.demo-login-chip-copy strong { font-size: .76rem; line-height: 1.2; }
.demo-login-chip-copy small { margin-top: .15rem; color: #718096; font-size: .66rem; line-height: 1.2; }
.demo-login-chip-arrow { color: #9AA9B8; font-size: .7rem; }

/* ── Form elements ────────────────────────────────────────────────── */
.form-group { margin-bottom: 1.35rem; }
.form-label {
  display: block;
  margin-bottom: 0.4rem;
  font-weight: 500;
  color: #374151;
  font-size: 0.875rem;
}
.form-label i { margin-right: 0.4rem; color: #9CA3AF; }
.input-wrap { position: relative; }
.form-input {
  width: 100%;
  padding: 0.65rem 1rem;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  font-size: 0.95rem;
  color: #1A202C;
  background: #fff;
  transition: all 0.2s;
  font-family: inherit;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 51, 102, 0.12);
}
.toggle-pw {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #9CA3AF;
  cursor: pointer;
  padding: 0.4rem;
  transition: color 0.2s;
  font-size: 0.9rem;
}
.toggle-pw:hover { color: var(--primary); }
.toggle-pw:focus { outline: none; }

/* ── Checkbox row ─────────────────────────────────────────────────── */
.check-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
}
.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}
.check-row label {
  font-size: 0.875rem;
  color: #6B7280;
  cursor: pointer;
}

/* ── Submit button ────────────────────────────────────────────────── */
.auth-btn {
  width: 100%;
  padding: 0.75rem 1.5rem;
  background: var(--primary);
  border: none;
  border-radius: 8px;
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: inherit;
}
.auth-btn:hover {
  background: var(--hover);
  box-shadow: 0 0 0 4px rgba(0, 51, 102, 0.2);
  transform: translateY(-1px);
}
.auth-btn:active { transform: translateY(0); }

/* ── Dev mode badge ───────────────────────────────────────────────── */
.dev-mode-badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #FEF3C7;
  border: 1px solid #FDE68A;
  color: #B45309;
  border-radius: 8px;
  padding: 0.6rem 0.875rem;
  font-size: 0.8rem;
  margin-bottom: 1.5rem;
}

/* ── Auth footer ──────────────────────────────────────────────────── */
.auth-footer {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid #F3F4F6;
  color: #9CA3AF;
  font-size: 0.8rem;
  line-height: 1.5;
}

/* ── Responsive ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
  .auth-wrapper { flex-direction: column; }
  .auth-sidebar, .auth-form-side { flex: 0 0 100%; }
  .auth-sidebar { padding: 2rem; min-height: 240px; }
  .auth-quote { display: none; }
  .auth-form-side { padding: 2rem; }
}
@media (max-width: 480px) {
  .auth-main { padding: 1rem 0.75rem; }
  .auth-sidebar { padding: 1.5rem; }
  .auth-form-side { padding: 1.5rem; }
  .auth-title { font-size: 1.2rem; }
  .sidebar-logo { width: 100px; }
}
