/* Preview-Stylesheet für Login / Register / Forgot-Password Mockups.
   Wird nach Abnahme in static/css/auth.css refaktoriert + von den echten Templates geladen. */

body {
  font-family: "Source Sans 3", system-ui, sans-serif;
  background: var(--theme-bg);
  color: var(--theme-text);
  min-height: 100vh;
  margin: 0;
}

/* Page = two-column grid */
.auth-page {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}
@media (max-width: 1024px) {
  .auth-page { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
}

/* LEFT: Form column — Brand/Foot sit close to the edges (matches sidebar 24px 16px),
   das Form-Inner zentriert sich via auth-inner und hat eigenes max-width. */
.auth-form-col {
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  min-height: 100vh;
  box-sizing: border-box;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  font-family: var(--font-display);
  font-size: 1.5rem;
  line-height: 1;
  font-weight: 600;
  font-variation-settings: 'opsz' 60;
  letter-spacing: -0.015em;
  color: var(--theme-text);
  text-decoration: none;
  align-self: flex-start;
}
.auth-brand:hover,
.auth-brand:focus {
  color: var(--theme-text);
}
.auth-brand .glyph {
  color: var(--ktv-brand);
  font-size: 1.05em;
  font-weight: 400;
  line-height: 1;
  display: inline-block;
  vertical-align: -0.05em;
}
.auth-brand .accent { color: var(--ktv-brand); }

.auth-inner {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 100%;
  padding: 2rem 0;
}
.auth-content {
  width: 100%;
  max-width: 420px;
}

.auth-hero { margin-bottom: 2rem; text-align: left; }
.auth-hero h1 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, 2.5rem);
  font-weight: 500;
  font-variation-settings: 'opsz' 60;
  line-height: 1.1;
  margin: 0 0 0.5rem;
  color: var(--theme-text);
  letter-spacing: -0.015em;
}
.auth-hero p.sub {
  font-size: 0.9375rem;
  color: var(--theme-text-muted);
  margin: 0;
  line-height: 1.5;
}

.form-stack { display: flex; flex-direction: column; gap: 0.75rem; }

.field { display: flex; flex-direction: column; }
.field input[type="text"],
.field input[type="email"],
.field input[type="password"] {
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  height: 52px;
  padding: 0 1rem;
  font-size: 0.9375rem;
  font-family: inherit;
  color: var(--theme-text);
  background: var(--input-bg);
  border: 1px solid var(--theme-border);
  border-radius: 12px;
  transition: border-color 120ms ease, box-shadow 120ms ease, background 120ms ease;
}
.field input::placeholder { color: var(--theme-text-muted); opacity: 1; }
.field input:hover { border-color: var(--theme-text-muted); }
.field input:focus {
  outline: none;
  border-color: var(--ktv-brand);
  box-shadow: 0 0 0 3px rgba(238, 156, 68, 0.15);
}

/* Browser-Autofill (Chrome/Safari) neutralisieren — sonst überschreibt Chrome
   den Input-Background mit einem hellen Fill, sobald gespeicherte Credentials
   greifen. Box-Shadow-Trick: deckt den Autofill-Background mit unserer Theme-Farbe ab. */
.field input:-webkit-autofill,
.field input:-webkit-autofill:hover,
.field input:-webkit-autofill:focus,
.field input:-webkit-autofill:active {
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset;
  -webkit-text-fill-color: var(--theme-text);
  caret-color: var(--theme-text);
  transition: background-color 5000s ease-in-out 0s;
}
.field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset,
                      0 0 0 3px rgba(238, 156, 68, 0.15);
}

/* Input bg tokens */
:root { --input-bg: #F8F8F7; }
.dark-mode { --input-bg: #14120F; }

.field-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  color: var(--theme-text-muted);
}

.link {
  color: var(--ktv-brand);
  font-weight: 500;
  text-decoration: none;
  transition: opacity 120ms;
}
.link:hover { opacity: 0.75; }

.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--theme-text-muted);
  cursor: pointer;
  user-select: none;
}
.checkbox input { width: 15px; height: 15px; accent-color: var(--ktv-brand); margin: 0; flex-shrink: 0; }

.btn {
  appearance: none;
  box-sizing: border-box;
  width: 100%;
  height: 52px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-family: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms, border-color 120ms, color 120ms, transform 120ms;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  text-decoration: none;
}
.btn-primary { background: var(--ktv-brand); color: #FFFFFF; }
.btn-primary:hover { background: var(--ktv-brand-shade); }
.btn-primary:active { transform: translateY(1px); }
.btn-secondary {
  background: transparent;
  color: var(--theme-text);
  border-color: var(--theme-border);
}
.btn-secondary:hover {
  background: var(--theme-hover-bg);
  border-color: var(--theme-text-muted);
}

.divider {
  display: flex; align-items: center; gap: 0.875rem;
  margin: 1.5rem 0;
  color: var(--theme-text-muted);
  font-size: 0.75rem; letter-spacing: 0.05em; text-transform: uppercase;
}
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--theme-border); }

.auth-foot {
  display: flex; gap: 1rem;
  font-size: 0.8125rem;
  color: var(--theme-text-muted);
  align-self: flex-start;
  padding-top: 1rem;
}
.auth-foot a { color: var(--theme-text-muted); text-decoration: none; }
.auth-foot a:hover { color: var(--theme-text); }
.auth-foot .sep { opacity: 0.4; }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 3rem; }
.pw-toggle {
  position: absolute; right: 0.75rem; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--theme-text-muted);
  cursor: pointer; padding: 8px; line-height: 1; font-size: 1rem;
}
.pw-toggle:hover { color: var(--theme-text); }

/* Password strength bar (Register) */
.pw-strength {
  display: flex; gap: 4px; margin-top: 0.5rem;
}
.pw-strength .seg {
  flex: 1; height: 4px; border-radius: 999px;
  background: var(--theme-border);
  transition: background 200ms ease;
}
.pw-strength[data-score="1"] .seg:nth-child(-n+1) { background: #EF4444; }
.pw-strength[data-score="2"] .seg:nth-child(-n+2) { background: #F97316; }
.pw-strength[data-score="3"] .seg:nth-child(-n+3) { background: #EAB308; }
.pw-strength[data-score="4"] .seg:nth-child(-n+4) { background: #22C55E; }
.pw-strength-label {
  margin-top: 0.25rem; font-size: 0.75rem; color: var(--theme-text-muted);
}

/* Server-rendered Messages (success / error / info) — sitzen über dem Form */
.auth-msg {
  display: flex;
  align-items: flex-start;
  gap: 0.625rem;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--theme-border);
  background: var(--input-bg);
  font-size: 0.875rem;
  line-height: 1.45;
  margin-bottom: 1rem;
}
.auth-msg i { margin-top: 2px; flex-shrink: 0; }
.auth-msg strong { display: block; font-weight: 600; }
.auth-msg-success { border-left: 3px solid #22C55E; }
.auth-msg-success i { color: #22C55E; }
.auth-msg-error   { border-left: 3px solid #EF4444; }
.auth-msg-error   i { color: #EF4444; }
.auth-msg-info    { border-left: 3px solid var(--ktv-brand); }
.auth-msg-info    i { color: var(--ktv-brand); }

/* Info-box (forgot-password "So funktioniert's") */
.info-box {
  margin-bottom: 1.25rem;
  padding: 0.875rem 1rem;
  border: 1px solid var(--theme-border);
  border-left: 3px solid var(--ktv-brand);
  border-radius: 10px;
  background: var(--input-bg);
  font-size: 0.875rem;
  color: var(--theme-text);
  line-height: 1.55;
}
.info-box ol { margin: 0.375rem 0 0; padding-left: 1.125rem; }
.info-box li { color: var(--theme-text-muted); padding-left: 0.125rem; }
.info-box strong { color: var(--theme-text); font-weight: 600; display: block; margin-bottom: 0.25rem; }

/* Back-Link unter Primary-Button (Forgot-Page) — kein Divider, da kein Alternative */
.back-link-row {
  margin-top: 1rem;
  text-align: center;
  font-size: 0.875rem;
}

/* RIGHT: Visual column */
.auth-visual {
  position: relative;
  background:
    linear-gradient(180deg, rgba(26,24,20,0.15) 0%, rgba(26,24,20,0.65) 100%),
    url("/static/img/auth-cathedral.jpg") center/cover no-repeat,
    #2a2520;
  overflow: hidden;
}
.auth-visual::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 50% 110%, rgba(238,156,68,0.20), transparent 55%);
  pointer-events: none;
}
.auth-visual-text {
  position: absolute;
  left: clamp(2rem, 4vw, 3rem);
  bottom: clamp(2rem, 5vh, 3rem);
  right: clamp(2rem, 4vw, 3rem);
  color: #FAFAF9;
  font-family: var(--font-display);
  z-index: 1;
}
.auth-visual-text blockquote {
  margin: 0 0 0.75rem;
  font-size: clamp(1.25rem, 2.2vw, 1.5rem);
  font-weight: 400;
  font-variation-settings: 'opsz' 60;
  line-height: 1.4;
  letter-spacing: -0.005em;
  max-width: 32rem;
}
.auth-visual-text cite {
  font-style: normal;
  font-size: 0.8125rem;
  font-family: "Source Sans 3", sans-serif;
  color: rgba(250,250,249,0.7);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Theme-Toggle: dezenter Icon-Button oben rechts */
.theme-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 20;
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: transparent;
  color: var(--theme-text-muted);
  border: 1px solid var(--theme-border);
  cursor: pointer;
  transition: background 120ms, color 120ms, border-color 120ms;
  font-size: 0.875rem;
}
.theme-toggle:hover {
  background: var(--theme-hover-bg);
  color: var(--theme-text);
  border-color: var(--theme-text-muted);
}
/* Icon-Wechsel via body-Klasse */
.theme-toggle .icon-sun  { display: none; }
.theme-toggle .icon-moon { display: inline-block; }
body.dark-mode .theme-toggle .icon-sun  { display: inline-block; }
body.dark-mode .theme-toggle .icon-moon { display: none; }
