/* assets/css/auth.css
 * Dark theme for WorkLynx auth pages (forgot-password, reset-password,
 * verify-email, confirm-email, accept-invite, accept-auth-invite,
 * setup-mfa, verify-mfa).
 *
 * Mirrors the look of login.html / register.html (base.css).
 */

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

:root {
  --brand:        #667eea;
  --brand-dark:   #4f63c7;
  --grad:         linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --dark:         #0f172a;
  --muted:        #94a3b8;
  --border:       rgba(255,255,255,0.12);
  --surface-2:    rgba(255,255,255,0.06);
  --brand-border: rgba(102,126,234,0.5);
  --brand-soft:   rgba(102,126,234,0.15);
}

html { scroll-behavior: smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--dark);
  color: #e2e8f0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Grid overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(rgba(102,126,234,0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(102,126,234,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  pointer-events: none;
  z-index: 0;
}

/* Glow */
body::after {
  content: '';
  position: fixed;
  top: -200px; left: 50%; transform: translateX(-50%);
  width: 800px; height: 600px;
  background: radial-gradient(ellipse, rgba(102,126,234,0.2) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

/* ── Nav bar ─────────────────────────────────────────────────────────────────── */
.wl-auth-nav {
  position: relative;
  z-index: 10;
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(255,255,255,0.06);
}

.wl-auth-nav .logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 800;
  color: white;
  text-decoration: none;
}

.wl-auth-nav .logo img { width: 42px; height: 42px; }

.wl-auth-nav .nav-back {
  font-size: 0.85rem;
  color: #475569;
  text-decoration: none;
  transition: color 0.2s;
}
.wl-auth-nav .nav-back:hover { color: white; }

/* ── Centered card container ─────────────────────────────────────────────────── */
main.wl-auth {
  flex: 1;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 20px;
  max-width: 460px;
  width: 100%;
  margin: 0 auto;
}

/* Glass card wrapping the content */
main.wl-auth::before {
  content: '';
  position: absolute;
  inset: 40px 0;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 20px;
  backdrop-filter: blur(12px);
  z-index: -1;
}

/* Push children to stay above the pseudo-element */
main.wl-auth > * {
  position: relative;
  z-index: 1;
  width: 100%;
  padding-left: 36px;
  padding-right: 36px;
}

/* ── Logo ────────────────────────────────────────────────────────────────────── */
.wl-auth__logo {
  text-align: center;
  margin-bottom: 20px;
  padding-top: 8px;
}

.wl-auth__logo img {
  height: 32px;
  width: auto;
}

/* ── Typography ──────────────────────────────────────────────────────────────── */
main.wl-auth h1 {
  font-size: 1.4rem;
  font-weight: 700;
  color: white;
}

main.wl-auth h2 {
  font-size: 1.3rem;
  font-weight: 700;
  color: white;
}

main.wl-auth p {
  line-height: 1.65;
}

main.wl-auth a {
  color: #a5b4fc;
  text-decoration: none;
  transition: color 0.2s;
}
main.wl-auth a:hover { color: white; }

/* ── Form layout (.wl-form) ─────────────────────────────────────────────────── */
.wl-form {
  display: grid;
  gap: 12px;
}

.wl-form label {
  font-size: 0.82rem;
  font-weight: 600;
  color: #94a3b8;
  margin: 0 0 -6px;
  letter-spacing: 0.02em;
}

.wl-form input,
.wl-form select,
.wl-form textarea {
  width: 100%;
  padding: 11px 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 9px;
  color: white;
  font-size: 0.93rem;
  font-family: inherit;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
}

.wl-form input::placeholder,
.wl-form textarea::placeholder {
  color: #475569;
}

.wl-form input:focus,
.wl-form select:focus,
.wl-form textarea:focus {
  border-color: rgba(102,126,234,0.6);
  background: rgba(102,126,234,0.08);
}

.wl-form input:disabled,
.wl-form select:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.wl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 9px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.06);
  color: #e2e8f0;
  font-weight: 700;
  font-size: 0.93rem;
  font-family: inherit;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
  line-height: 1;
  text-decoration: none;
}

.wl-btn:hover {
  background: rgba(255,255,255,0.1);
  border-color: rgba(255,255,255,0.2);
}

.wl-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.wl-btn.wl-btn--primary {
  width: 100%;
  padding: 13px;
  background: var(--grad);
  color: white;
  border: none;
  box-shadow: 0 4px 16px rgba(102,126,234,0.35);
}

.wl-btn.wl-btn--primary:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(102,126,234,0.45);
}

.wl-btn.wl-btn--primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

a.wl-btn {
  width: fit-content;
  text-decoration: none;
}

a.wl-btn.wl-btn--primary {
  width: fit-content;
  display: inline-flex;
}

/* ── Alerts ──────────────────────────────────────────────────────────────────── */
.wl-alert {
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.85rem;
  margin-bottom: 16px;
  border: 1px solid transparent;
}

.wl-alert--error {
  background: rgba(239,68,68,0.12);
  border-color: rgba(239,68,68,0.3);
  color: #fca5a5;
}

.wl-alert--success {
  background: rgba(34,197,94,0.12);
  border-color: rgba(34,197,94,0.3);
  color: #86efac;
}

.wl-alert--warn {
  background: rgba(234,179,8,0.12);
  border-color: rgba(234,179,8,0.3);
  color: #fde68a;
}

/* ── MFA code input ──────────────────────────────────────────────────────────── */
details summary {
  color: #94a3b8;
}

code {
  background: rgba(255,255,255,0.06);
  border-radius: 6px;
  color: #e2e8f0;
}

/* ── Footer ──────────────────────────────────────────────────────────────────── */
.wl-auth-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 24px 20px;
  color: #1e293b;
  font-size: 0.8rem;
  border-top: 1px solid rgba(255,255,255,0.04);
}
.wl-auth-footer a { color: #334155; text-decoration: none; }
.wl-auth-footer a:hover { color: #64748b; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .wl-auth-nav { padding: 16px 20px; }

  main.wl-auth {
    padding: 40px 10px;
  }

  main.wl-auth::before {
    inset: 20px 0;
  }

  main.wl-auth > * {
    padding-left: 22px;
    padding-right: 22px;
  }
}

@media (max-width: 480px) {
  main.wl-auth > * {
    padding-left: 16px;
    padding-right: 16px;
  }
}
