/* =============================================================================
   TechNerds Portal — Login Page
   File: public/assets/css/login.css

   Professional split-panel design matching the TechNerds Institute CMS login:
   fixed navy/maroon brand panel on the left, flush light-gray form panel on
   the right — no floating card, no shadow, sharp square corners throughout.
   ============================================================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ── Reset ─────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Variables ─────────────────────────────────────────────────────────────── */
:root {
  --primary-dark:   #172336;
  --primary:        #750014;
  --primary-light:  #8C1028;
  --primary-faint:  rgba(117,0,20,0.08);
  --primary-ring:   rgba(117,0,20,0.14);
  --accent:         #750014;
  --accent-hover:   #5A0010;
  --bg-light:       #F9FAFB;
  --text-dark:      #172336;
  --text-secondary: #4B5563;
  --text-muted:     #9CA3AF;
  --border:         #E5E7EB;
  --border-hover:   #C9AEB2;
  --danger:         #ef4444;
  --danger-bg:      #fef2f2;
  --danger-ring:    rgba(239,68,68,0.12);
  --ease:           cubic-bezier(0.4,0,0.2,1);
  --fast:           0.15s;
  --normal:         0.25s;
}

html, body { height: 100%; }

/* ── Body ──────────────────────────────────────────────────────────────────── */
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-light);
  min-height: 100vh;
  color: var(--text-dark);
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

/* ═══════════════════════════════════════════════════════════
   WRAPPER — full-bleed split panel, edge to edge
   ═══════════════════════════════════════════════════════════ */
.login-wrapper {
  display: flex;
  width: 100%;
  min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════
   LEFT PANEL — fixed-width navy/maroon brand panel
   ═══════════════════════════════════════════════════════════ */
.login-left {
  flex: 0 0 60%;
  width: 60%;
  min-width: 0;
  min-height: 100vh;
  color: #fff;
  background: linear-gradient(160deg, var(--primary-dark) 0%, #0F1826 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 56px 48px;
  position: relative;
  overflow: hidden;
}

.login-left::before {
  content: '';
  position: absolute;
  width: 320px; height: 320px;
  background: rgba(117,0,20,0.35);
  top: -120px; right: -120px;
  filter: blur(40px);
}

.login-left::after {
  content: '';
  position: absolute;
  width: 220px; height: 220px;
  border: 1px solid rgba(255,255,255,0.08);
  bottom: -60px; left: -60px;
}

.login-left > * { position: relative; z-index: 1; }

/* ── Brand lockup ──────────────────────────────────────────────────────────
   Matches the CMS admin login exactly: a maroon square badge + wordmark,
   sharp corners, no rounding. */
.brand-lockup { display: flex; align-items: center; gap: 12px; }
.brand-lockup .mark {
  width: 40px; height: 40px; background: var(--primary); border-radius: 0;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.brand-lockup .mark i { color: #fff; font-size: 17px; }
.brand-lockup .text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-lockup .word { font-size: 17px; font-weight: 800; letter-spacing: 0.4px; }
.brand-lockup .tag { font-size: 10px; font-weight: 700; letter-spacing: 2.2px; text-transform: uppercase; margin-top: 2px; }
.brand-lockup.on-dark .word { color: #fff; }
.brand-lockup.on-dark .tag { color: rgba(255,255,255,0.6); }
.brand-lockup.on-light .word { color: var(--primary); }
.brand-lockup.on-light .tag { color: var(--primary-dark); }

.slogan {
  position: relative;
  min-height: 190px;
  overflow: hidden;
}

.slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
  pointer-events: none;
}

.slide.active {
  opacity: 1;
  position: relative;
  pointer-events: auto;
}

.slide h1 {
  font-size: 1.875rem;
  font-weight: 800;
  line-height: 1.28;
  letter-spacing: -0.3px;
  margin-bottom: 14px;
}

.slide p {
  font-size: 0.9375rem;
  color: rgba(255,255,255,0.65);
  line-height: 1.6;
  max-width: 340px;
}

/* Dots — small sharp bars, not pills */
.slider-dots {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 28px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 0;
  background: transparent;
  border: none;
  cursor: pointer;
  outline: none;
  transition: all var(--normal) var(--ease);
}

.dot::before {
  content: '';
  display: block;
  width: 100%;
  height: 3px;
  background: rgba(255,255,255,0.28);
  margin-top: 3px;
  transition: background var(--fast) var(--ease);
}

.dot:hover::before { background: rgba(255,255,255,0.55); }

.dot.active {
  width: 26px;
}
.dot.active::before { background: #fff; }

.dot:focus-visible {
  outline: 1px solid rgba(255,255,255,0.8);
  outline-offset: 3px;
}

.login-left-foot {
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

/* ═══════════════════════════════════════════════════════════
   RIGHT PANEL — flush light panel, form centred, no card chrome
   ═══════════════════════════════════════════════════════════ */
.login-right {
  flex: 0 0 40%;
  width: 40%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  background: var(--bg-light);
  position: relative;
}

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

.card-header {
  margin-bottom: 30px;
}

.card-header h2 {
  font-size: 1.375rem;
  font-weight: 800;
  color: var(--text-dark);
  letter-spacing: -0.3px;
  margin-bottom: 6px;
}

.card-header p {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

/* ── Form Groups ───────────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }

.form-group label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}

.form-row-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}
.form-row-between label { margin-bottom: 0; }

/* ── Input Wrapper ─────────────────────────────────────────────────────────── */
.input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-wrapper > i.fas {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 13px;
  line-height: 1;
  color: var(--text-muted);
  pointer-events: none;
  z-index: 2;
  transition: color var(--fast) var(--ease);
}

.input-wrapper input {
  width: 100%;
  padding: 11px 42px 11px 38px;
  border: 1px solid var(--border);
  border-radius: 0;
  background: #fff;
  color: var(--text-dark);
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  outline: none;
  transition:
    border-color var(--fast) var(--ease),
    box-shadow   var(--fast) var(--ease);
}

.input-wrapper input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.input-wrapper input:hover {
  border-color: var(--border-hover);
}

.input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-ring);
  outline: none;
}

.input-wrapper input:focus-visible {
  outline: none;
}

.input-wrapper:focus-within > i.fas {
  color: var(--primary);
}

.input-wrapper input.error {
  border-color: var(--danger);
  background: var(--danger-bg);
}

.input-wrapper input.error:focus {
  box-shadow: 0 0 0 3px var(--danger-ring);
}

.input-wrapper:has(input.error) > i.fas {
  color: var(--danger);
}

/* ── Eye / Password Toggle ─────────────────────────────────────────────────── */
.toggle-password {
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 0;
  cursor: pointer;
  color: var(--text-muted);
  z-index: 3;
  transition:
    color      var(--fast) var(--ease),
    background var(--fast) var(--ease);
}

.toggle-password i {
  font-size: 13px;
  line-height: 1;
  pointer-events: none;
}

.toggle-password:hover {
  color: var(--primary);
  background: var(--primary-faint);
}

.toggle-password:active {
  background: rgba(117,0,20,0.14);
}

.toggle-password:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

/* ── Error Text ────────────────────────────────────────────────────────────── */
.error-text {
  display: block;
  margin-top: 6px;
  font-size: 0.74rem;
  font-weight: 500;
  color: var(--danger);
}

/* ── Alert Boxes ───────────────────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 11px 14px;
  border-radius: 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  margin-bottom: 18px;
}

.alert-error {
  background: var(--danger-bg);
  color: #991b1b;
  border-left: 3px solid var(--danger);
}

.alert-error i { margin-top: 2px; flex-shrink: 0; }

.alert-success {
  background: #d1fae5;
  color: #065f46;
  border-left: 3px solid #10b981;
}

/* ── Sign In Button ────────────────────────────────────────────────────────── */
.signin-btn {
  position: relative;
  width: 100%;
  padding: 12px 20px;
  margin-top: 6px;
  background: var(--primary);
  color: #fff;
  font-family: 'Inter', sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  border: none;
  border-radius: 0;
  cursor: pointer;
  transition: background var(--fast) var(--ease);
}

.signin-btn:hover          { background: var(--primary-light); }
.signin-btn:active         { background: var(--accent-hover); }
.signin-btn:disabled       { opacity: 0.65; cursor: not-allowed; }
.signin-btn:focus-visible  { outline: 2px solid var(--primary); outline-offset: 2px; }

.signin-btn .btn-text,
.signin-btn .btn-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.signin-btn .hidden { display: none !important; }

/* ── Links ─────────────────────────────────────────────────────────────────── */
.register-link {
  text-align: center;
  margin-top: 22px;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--text-secondary);
}

.register-link a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.register-link a:hover { color: var(--accent-hover); text-decoration: underline; }

.forgot-link a,
.form-row-between .link-sm {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
}

.forgot-link a:hover,
.form-row-between .link-sm:hover { text-decoration: underline; }

.forgot-link { text-align: center; margin-top: 12px; }

/* ── Demo Credentials ──────────────────────────────────────────────────────── */
.demo-credentials {
  margin-top: 26px;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 0;
  text-align: center;
}

.demo-credentials > p {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 10px;
}

.demo-credentials > p:last-child {
  font-size: 0.66rem;
  font-weight: 400;
  color: var(--text-muted);
  margin-top: 8px;
  margin-bottom: 0;
}

.demo-credentials code {
  display: block;
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 0;
  padding: 7px 12px;
  margin: 5px 0;
  font-family: 'Monaco','Consolas',monospace;
  font-size: 0.78rem;
  color: var(--text-dark);
  font-weight: 500;
}

/* ═══════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 968px) {
  .login-left  { display: none; }
  .login-right { flex: 1; width: 100%; }
}

@media (max-width: 375px) {
  .login-right { padding: 28px 18px; }
  .card-header h2 { font-size: 1.2rem; }
}

/* ═══════════════════════════════════════════════════════════
   ACCESSIBILITY & PREFERENCES
   ═══════════════════════════════════════════════════════════ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

@media (prefers-contrast: high) {
  .input-wrapper input { border-width: 2px; }
  .signin-btn          { border: 2px solid #fff; }
}

@media print {
  .login-left,
  .demo-credentials, .register-link, .forgot-link { display: none; }
}
