/* DozentenJournal – Auth Page – Light Theme */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* === Auth Overlay: covers WP theme completely === */
/* When rendered inline (not standalone), the overlay is position:fixed */
#dj-auth-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 999999 !important;
  overflow-y: auto !important;
  background: var(--bg) !important;
  font-family: 'Lexend', system-ui, sans-serif;
}
#dj-auth-overlay .auth-bg {
  min-height: 100%;
}

:root {
  --brand:     #3b1f61;
  --brand-mid: #5b3fa0;
  --brand-lt:  #7c5fc8;
  --bg:        #f4f2f9;
  --card:      #ffffff;
  --card2:     #f8f6fc;
  --border:    #e4dff2;
  --text:      #1a1230;
  --muted:     #7a6fa0;
  --input-bg:  #f8f6fc;
  --green:     #16a34a;
  --red:       #dc2626;
}

html, body {
  height: 100%; font-family: 'Lexend', system-ui, sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.auth-bg {
  min-height: 100vh;
  background:
    radial-gradient(ellipse 80% 60% at 10% -10%, rgba(124,95,200,.18) 0%, transparent 55%),
    radial-gradient(ellipse 60% 50% at 90% 110%, rgba(59,31,97,.12) 0%, transparent 50%),
    radial-gradient(ellipse 40% 40% at 50% 50%, rgba(167,139,250,.06) 0%, transparent 60%),
    var(--bg);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}

.auth-card {
  width: 100%; max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 44px 40px 36px;
  box-shadow:
    0 20px 60px rgba(59,31,97,.12),
    0 4px 16px rgba(59,31,97,.06),
    0 1px 0 rgba(255,255,255,.9) inset;
  position: relative; overflow: hidden;
}
.auth-card::before {
  content: '';
  position: absolute; top: 0; left: 0; right: 0; height: 4px;
  background: linear-gradient(90deg, var(--brand), var(--brand-lt), #a78bfa, var(--brand-lt));
  background-size: 200% 100%;
}

.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo-icon {
  width: 62px; height: 62px;
  background: linear-gradient(135deg, var(--brand), var(--brand-lt));
  border-radius: 18px; margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(59,31,97,.28), 0 2px 0 rgba(255,255,255,.15) inset;
  position: relative;
}
.auth-logo-icon svg { width: 32px; height: 32px; fill: white; filter: drop-shadow(0 1px 2px rgba(0,0,0,.2)); }
.auth-logo h1 { font-size: 22px; font-weight: 800; letter-spacing: -.03em; color: var(--text); }
.auth-logo p  { font-size: 13px; color: var(--muted); margin-top: 5px; }

/* Tabs */
.auth-tabs {
  display: flex; border-radius: 10px; overflow: hidden;
  background: var(--card2); border: 1px solid var(--border);
  margin-bottom: 24px;
}
.auth-tab {
  flex: 1; padding: 11px 16px; border: none;
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 14px; font-weight: 600;
  cursor: pointer; transition: all .2s;
}
.auth-tab.active { background: var(--brand); color: #fff; }

/* Form */
.auth-field { margin-bottom: 16px; }
.auth-label {
  display: block; font-size: 12px; font-weight: 700;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: .06em; margin-bottom: 7px;
}
.auth-input {
  width: 100%; padding: 12px 14px;
  background: var(--input-bg); border: 1.5px solid var(--border);
  border-radius: 10px; color: var(--text);
  font-family: inherit; font-size: 15px;
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.auth-input:focus {
  border-color: var(--brand-lt);
  box-shadow: 0 0 0 3px rgba(124,95,200,.15);
  background: #fff;
}
.auth-input::placeholder { color: #c4bbd8; }
.auth-input-wrap { position: relative; }
.auth-pw-toggle {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 18px; line-height: 1;
}

/* Primary button */
.auth-btn {
  width: 100%; padding: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-lt));
  color: #fff; border: none; border-radius: 12px;
  font-family: inherit; font-size: 15px; font-weight: 700;
  cursor: pointer; margin-top: 8px;
  transition: opacity .15s, transform .1s, box-shadow .15s;
  box-shadow: 0 4px 16px rgba(59,31,97,.3);
}
.auth-btn:hover { opacity: .92; transform: translateY(-1px); box-shadow: 0 6px 20px rgba(59,31,97,.35); }
.auth-btn:active { transform: translateY(0); }
.auth-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }

/* Messages */
.auth-msg {
  padding: 12px 14px; border-radius: 10px;
  font-size: 13px; margin-bottom: 16px; display: none; font-weight: 500;
}
.auth-msg.err { background: #fef2f2; color: #b91c1c; border: 1px solid #fecaca; }
.auth-msg.ok  { background: #f0fdf4; color: #15803d; border: 1px solid #bbf7d0; }

/* 2FA per-digit input */
.twofa-panel { display: none; }
.twofa-title { font-size: 18px; font-weight: 800; text-align: center; margin-bottom: 8px; color: var(--text); }
.twofa-sub   { font-size: 13px; color: var(--muted); text-align: center; margin-bottom: 24px; line-height: 1.5; }
.twofa-digits {
  display: flex; gap: 8px; justify-content: center; margin-bottom: 20px;
}
.twofa-digit {
  width: 48px; height: 56px;
  background: var(--input-bg); border: 2px solid var(--border);
  border-radius: 12px; color: var(--text);
  font-family: 'Courier New', monospace; font-size: 24px; font-weight: 700;
  text-align: center; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
.twofa-digit:focus {
  border-color: var(--brand-lt);
  box-shadow: 0 0 0 3px rgba(124,95,200,.15);
  background: #fff;
}
.twofa-digit.filled { border-color: var(--brand-mid); background: #fff; }
.twofa-resend {
  text-align: center; margin-top: 12px;
  font-size: 13px; color: var(--muted);
}
.twofa-resend a { color: var(--brand); cursor: pointer; text-decoration: none; font-weight: 600; }
.twofa-resend a:hover { text-decoration: underline; }

.auth-back {
  display: block; text-align: center; margin-top: 14px;
  font-size: 13px; color: var(--muted); cursor: pointer;
  background: none; border: none; width: 100%;
  font-family: inherit;
}
.auth-back:hover { color: var(--brand); }

.auth-footer {
  text-align: center; margin-top: 20px;
  font-size: 12px; color: #c4bbd8;
}

/* Onboarding */
.ob-steps { display: flex; gap: 4px; margin-bottom: 24px; }
.ob-step { flex: 1; height: 3px; border-radius: 2px; background: var(--border); transition: background .3s; }
.ob-step.active { background: var(--brand-lt); }
.ob-step.done   { background: #22c55e; }
.ob-color-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.ob-color {
  width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent; transition: transform .1s, border-color .1s;
}
.ob-color:hover { transform: scale(1.15); }
.ob-color.selected { border-color: var(--brand); }

@keyframes fadeInUp { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: none; } }
.auth-card { animation: fadeInUp .3s ease; }

@media (max-width: 480px) {
  .auth-card { padding: 28px 20px 24px; border-radius: 16px; }
  .twofa-digit { width: 40px; height: 48px; font-size: 20px; }
}
