/**
 * ClubFlex – auth.css
 * Gemeinsames Design für den gesamten Auth-Bereich (Login, Registrieren, Verein gründen,
 * Passwort vergessen/zurücksetzen, E-Mail bestätigen). „Zentriert & klar" – eine fokussierte
 * Karte, identisch zur Login-Seite. Eine Quelle der Wahrheit.
 */

:root {
  --cf-primary: #4F46E5;
  --cf-primary-dark: #4338CA;
  --cf-dark: #0F172A;
  --cf-bg: #F4F5FB;
  --cf-border: #E2E8F0;
  --cf-text-gray: #64748B;
  --cf-success: #10B981;
  --cf-success-light: #D1FAE5;
  --cf-warning: #F59E0B;
  --cf-warning-light: #FEF3C7;
  --cf-info: #3B82F6;
  --cf-info-light: #DBEAFE;
  --cf-danger: #EF4444;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Plus Jakarta Sans', sans-serif;
  background: var(--cf-bg);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  color: var(--cf-dark);
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.auth-card {
  width: 100%;
  max-width: 440px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  border-radius: 20px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04), 0 14px 38px -10px rgba(15, 23, 42, 0.14);
  padding: 32px 38px 26px;
  animation: authCardIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.auth-card--wide { max-width: 540px; }

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* Marke */
.auth-brand {
  display: flex; align-items: center; justify-content: center;
  gap: 10px; margin-bottom: 18px;
}
.auth-brand-mark {
  width: 38px; height: 38px; border-radius: 11px;
  background: var(--cf-primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.auth-brand-word { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; color: var(--cf-dark); }
.auth-brand-word span { color: var(--cf-primary); }
.auth-brand-logo { width: 160px; max-width: 70%; height: auto; display: block; border-radius: 16px; }

/* Kopf */
.auth-head { text-align: center; margin-bottom: 20px; }
.auth-title { font-size: 22px; font-weight: 800; letter-spacing: -0.4px; color: var(--cf-dark); margin: 0 0 6px; }
.auth-subtitle { font-size: 14px; color: var(--cf-text-gray); margin: 0; font-weight: 500; line-height: 1.5; }

/* Felder */
.auth-field { margin-bottom: 14px; }
.auth-label { display: block; font-size: 12.5px; font-weight: 700; color: #334155; margin-bottom: 7px; }
.auth-label-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 7px; }
.auth-label-row .auth-label { margin: 0; }

.auth-input-wrap { position: relative; }
.auth-input,
.auth-input-wrap input,
.auth-input-wrap select,
.auth-input-wrap textarea {
  width: 100%;
  border: 1.5px solid var(--cf-border);
  background: #fff;
  padding: 12px 15px;
  border-radius: 12px;
  font-size: 14.5px;
  font-weight: 500;
  color: var(--cf-dark);
  font-family: inherit;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.auth-input-wrap--icon input { padding-left: 42px; }
.auth-input-wrap--icon.has-toggle input { padding-right: 44px; }
.auth-input::placeholder,
.auth-input-wrap input::placeholder,
.auth-input-wrap textarea::placeholder { color: #94A3B8; font-weight: 400; }
.auth-input:focus,
.auth-input-wrap input:focus,
.auth-input-wrap select:focus,
.auth-input-wrap textarea:focus {
  outline: none;
  border-color: var(--cf-primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}
.auth-input-icon {
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  color: #94A3B8; font-size: 16px; pointer-events: none;
}
.auth-input-wrap input:focus ~ .auth-input-icon { color: var(--cf-primary); }

.pw-toggle {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: #94A3B8;
  cursor: pointer; padding: 8px; font-size: 16px; line-height: 1;
}
.pw-toggle:hover { color: var(--cf-primary); }

.auth-hint { font-size: 12px; color: var(--cf-text-gray); margin-top: 6px; line-height: 1.45; }

.auth-link { color: var(--cf-primary); font-weight: 700; text-decoration: none; }
.auth-link:hover { text-decoration: underline; }
.forgot-pass { font-size: 12.5px; color: var(--cf-primary); font-weight: 700; text-decoration: none; }
.forgot-pass:hover { text-decoration: underline; }

.remember-me {
  display: flex; align-items: center; gap: 8px;
  color: var(--cf-text-gray); font-weight: 600; font-size: 13.5px;
  cursor: pointer; margin-bottom: 18px;
}
.remember-me input { width: 17px; height: 17px; accent-color: var(--cf-primary); }

/* Buttons */
.btn-auth {
  width: 100%; background: var(--cf-primary); color: #fff; border: none;
  padding: 13px; border-radius: 12px; font-size: 15px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px; font-family: inherit;
  transition: background 0.18s, transform 0.12s, box-shadow 0.18s;
}
.btn-auth:hover { background: var(--cf-primary-dark); transform: translateY(-1px); box-shadow: 0 10px 24px rgba(79, 70, 229, 0.28); }
.btn-auth:disabled { opacity: 0.7; cursor: wait; transform: none; box-shadow: none; }

.btn-auth-secondary {
  width: 100%; background: #fff; color: #334155; border: 1.5px solid var(--cf-border);
  padding: 12px; border-radius: 12px; font-size: 14.5px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  text-decoration: none; font-family: inherit;
  transition: border-color 0.18s, background 0.18s;
}
.btn-auth-secondary:hover { border-color: #C7D2FE; background: #FAFAFE; }

/* Trenner / Social / Demo */
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 18px 0; color: #94A3B8; font-size: 12.5px; font-weight: 600; }
.auth-divider .line { flex: 1; height: 1px; background: var(--cf-border); }

.btn-social {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; padding: 11px; border: 1.5px solid var(--cf-border); border-radius: 12px;
  background: #fff; color: #334155; font-weight: 700; font-size: 14px;
  text-decoration: none; cursor: pointer; transition: border-color 0.18s, background 0.18s;
}
.btn-social:hover { border-color: #C7D2FE; background: #FAFAFE; }

.btn-demo {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 11px; margin-top: 12px; border: none; border-radius: 13px;
  background: transparent; color: var(--cf-text-gray); font-weight: 600; font-size: 13.5px;
  text-decoration: none; transition: color 0.18s;
}
.btn-demo:hover { color: var(--cf-dark); }
.btn-demo i { color: var(--cf-primary); font-size: 15px; }

/* Fuß-Links */
.auth-foot-link {
  text-align: center; margin-top: 18px; padding-top: 16px;
  border-top: 1px solid #EEF2F6; font-size: 13.5px; color: var(--cf-text-gray);
}
.auth-foot-link a { color: var(--cf-primary); font-weight: 700; text-decoration: none; }
.auth-foot-link a:hover { text-decoration: underline; }

.auth-footer { text-align: center; padding: 16px; font-size: 12px; color: #94A3B8; }
.auth-footer a { color: inherit; text-decoration: none; margin: 0 8px; white-space: nowrap; }
.auth-footer a:hover { color: var(--cf-text-gray); }

/* Status-/Erfolgszustand (Mail gesendet, E-Mail bestätigt …) */
.auth-state { text-align: center; animation: authCardIn 0.4s ease-out; }
.auth-state-icon {
  width: 66px; height: 66px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  margin: 0 auto 18px; font-size: 28px;
  background: var(--cf-success-light); color: var(--cf-success);
}
.auth-state-icon--info { background: var(--cf-info-light); color: #2563EB; }
.auth-state-icon--warn { background: var(--cf-warning-light); color: #B45309; }
.auth-state-icon--danger { background: #FEE2E2; color: var(--cf-danger); }

/* Alerts (Inhalt teils per JS) */
.alert {
  padding: 12px 14px; border-radius: 12px; margin-bottom: 18px;
  font-size: 13px; font-weight: 600; display: flex; align-items: flex-start; gap: 10px;
}
.alert i { margin-top: 1px; }
.alert[hidden] { display: none; }
.alert-warn { background: var(--cf-warning-light); color: #92400E; }
.alert-info { background: var(--cf-info-light); color: #1D4ED8; }
.alert-success { background: var(--cf-success-light); color: #047857; }
.alert-danger { background: #FEE2E2; color: #B91C1C; }
.alert-body { flex: 1; }
.alert-title { display: block; font-weight: 700; margin-bottom: 3px; }
.alert-text { display: block; line-height: 1.5; font-weight: 500; }
.alert-action { margin-top: 10px; }
.alert-button {
  border: none; background: rgba(15, 23, 42, 0.08); color: inherit;
  padding: 9px 13px; border-radius: 9px; font-size: 12.5px; font-weight: 700;
  cursor: pointer; transition: background 0.18s;
}
.alert-button:hover { background: rgba(15, 23, 42, 0.12); }
.alert-button:disabled { cursor: wait; opacity: 0.75; }

/* Toast weiter nach oben — Auth-Seiten haben keine 64px-Topbar (überschreibt app.css) */
#toast-container { top: 16px; }

/* Feld-Validierung */
.field-error { font-size: 12px; color: var(--cf-danger); margin-top: 5px; display: none; }
.field-error.show { display: block; }
.auth-input-wrap.has-error input,
.auth-input-wrap.has-error select,
.auth-input.has-error,
input.has-error, select.has-error {
  border-color: var(--cf-danger); box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

/* Mehrschritt-Anzeige (Verein gründen) */
.auth-steps { display: flex; align-items: center; gap: 8px; justify-content: center; margin-bottom: 22px; }
.auth-step-dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; background: #EEF1F8; color: #94A3B8;
  transition: background 0.2s, color 0.2s;
}
.auth-step-dot.active { background: var(--cf-primary); color: #fff; }
.auth-step-dot.done { background: var(--cf-success-light); color: var(--cf-success); }
.auth-step-line { width: 28px; height: 2px; background: var(--cf-border); }

/* Fortschrittsbalken (Wizard) */
.auth-progress { height: 4px; background: var(--cf-border); border-radius: 2px; overflow: hidden; margin-bottom: 22px; }
.auth-progress-bar { height: 100%; background: var(--cf-primary); border-radius: 2px; transition: width 0.3s ease; width: 0%; }

/* Wizard-Panels */
.panel { display: none; }
.panel.active { display: block; animation: authCardIn 0.3s ease-out; }

/* Zwei Felder nebeneinander */
.auth-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Passwort-Stärke (reset.php) */
.cf-pw-strength { margin-top: 8px; }
.cf-pw-strength-bar { height: 4px; background: var(--cf-border); border-radius: 2px; overflow: hidden; }
.cf-pw-strength-fill { height: 100%; border-radius: 2px; transition: width .3s ease, background .3s ease; width: 0%; }
.cf-pw-strength-fill.weak   { width: 25%;  background: var(--cf-danger); }
.cf-pw-strength-fill.fair   { width: 50%;  background: var(--cf-warning); }
.cf-pw-strength-fill.good   { width: 75%;  background: var(--cf-info); }
.cf-pw-strength-fill.strong { width: 100%; background: var(--cf-success); }
.cf-pw-strength-label { font-size: 11.5px; color: var(--cf-text-gray); margin-top: 4px; }

/* Club-Suche (register.php) */
.search-field { position: relative; }
.club-results {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20;
  background: #fff; border: 1px solid var(--cf-border); border-radius: 13px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12); overflow: hidden; display: none;
}
.club-results.show { display: block; }
.club-result {
  padding: 11px 14px; cursor: pointer; display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid #F1F5F9; transition: background 0.12s;
}
.club-result:last-child { border-bottom: none; }
.club-result:hover, .club-result.active { background: #F5F6FE; }
.selected-club {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1.5px solid var(--cf-primary); border-radius: 13px; background: #F5F6FE;
}

@media (max-width: 480px) {
  body { background: #fff; }
  .auth-shell { padding: 0; align-items: flex-start; }
  .auth-card { border: none; box-shadow: none; border-radius: 0; padding: 34px 22px; max-width: none; }
  .auth-grid-2 { grid-template-columns: 1fr; }
}

@media (prefers-color-scheme: dark) {
  body { background: #0B1220; color: #E2E8F0; }
  .auth-card { background: #0F172A; border-color: rgba(148, 163, 184, 0.16); box-shadow: 0 1px 2px rgba(2, 6, 23, 0.4), 0 20px 50px -12px rgba(2, 6, 23, 0.7); }
  .auth-brand-word, .auth-title { color: #F1F5F9; }
  .auth-subtitle, .remember-me, .auth-foot-link, .auth-divider, .auth-hint, .cf-pw-strength-label { color: #94A3B8; }
  .auth-label { color: #CBD5E1; }
  /* Links auf dunklem Grund aufhellen (Kontrast) */
  .auth-link, .forgot-pass, .auth-foot-link a { color: #A5B4FC; }
  .auth-brand-word span { color: #818CF8; }
  /* Logo hat eigenen weißen Hintergrund → wirkt im Dark-Mode als Badge (border-radius in Basis). */
  .auth-input, .auth-input-wrap input, .auth-input-wrap select, .auth-input-wrap textarea { background: #1E293B; border-color: rgba(148, 163, 184, 0.25); color: #E2E8F0; }
  .auth-input::placeholder, .auth-input-wrap input::placeholder { color: #64748B; }
  .auth-divider .line, .auth-step-line { background: rgba(148, 163, 184, 0.25); }
  .btn-social, .btn-auth-secondary { background: #1E293B; color: #E2E8F0; border-color: rgba(148, 163, 184, 0.25); }
  .btn-social:hover, .btn-auth-secondary:hover { background: #243044; }
  .auth-foot-link { border-top-color: rgba(148, 163, 184, 0.16); }
  .btn-demo { color: #94A3B8; } .btn-demo:hover { color: #E2E8F0; }
  .auth-footer a { color: #94A3B8; }
  .auth-step-dot { background: #1E293B; color: #64748B; }
  .club-results { background: #0F172A; border-color: rgba(148,163,184,.25); }
  .club-result { border-bottom-color: rgba(148,163,184,.12); }
  .club-result:hover, .club-result.active { background: #1E293B; }
  .selected-club { background: rgba(79,70,229,.12); }
  .alert-warn { background: rgba(245, 158, 11, 0.12); color: #FCD34D; }
  .alert-info { background: rgba(59, 130, 246, 0.12); color: #93C5FD; }
  .alert-success { background: rgba(16, 185, 129, 0.14); color: #6EE7B7; }
  .alert-danger { background: rgba(239, 68, 68, 0.14); color: #FCA5A5; }
  .alert-button { background: rgba(255, 255, 255, 0.10); } .alert-button:hover { background: rgba(255, 255, 255, 0.16); }
  .auth-state-icon { background: rgba(16,185,129,.14); color: #6EE7B7; }
  .auth-state-icon--info { background: rgba(59,130,246,.14); color: #93C5FD; }
  .auth-state-icon--warn { background: rgba(245,158,11,.14); color: #FCD34D; }
  .auth-state-icon--danger { background: rgba(239,68,68,.14); color: #FCA5A5; }
}
