:root {
  --bg: #FFFFFF;
  --surface: #F9FAFB;
  --border: #E5E7EB;
  --text: #111827;
  --text-secondary: #6B7280;
  --text-muted: #9CA3AF;
  --accent: #0F6E56;
  --accent-light: #E1F5EE;
  --accent-hover: #085041;
  --red-bg: #FEF2F2;
  --red-text: #B91C1C;
  --red-border: #FECACA;
}

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

html {
  height: 100%;
}

body {
  font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--surface);
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ---------- Page wrapper ---------- */
.auth-page {
  width: 100%;
  max-width: 440px;
  padding: 32px 20px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

/* ---------- Logo ---------- */
.auth-logo {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 26px;
  font-weight: 400;
  color: var(--text);
  letter-spacing: -0.01em;
  text-decoration: none;
  transition: opacity 0.15s ease;
}

.auth-logo:hover {
  opacity: 0.75;
}

/* ---------- Card ---------- */
.auth-card {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.06);
}

/* ---------- Tabs ---------- */
.auth-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
}

.auth-tab {
  flex: 1;
  padding: 14px 16px;
  border: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.auth-tab:hover {
  color: var(--text);
  background: var(--surface);
}

.auth-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  background: #fff;
}

/* ---------- Form ---------- */
.auth-form {
  padding: 32px;
}

.auth-form.hidden {
  display: none;
}

.auth-form-head {
  margin-bottom: 26px;
}

.auth-form-head h1 {
  font-family: 'DM Serif Display', Georgia, serif;
  font-size: 24px;
  font-weight: 400;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.2;
}

.auth-form-head p {
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- Fields ---------- */
.field {
  margin-bottom: 18px;
}

.field.hidden {
  display: none;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.field-label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}

.field-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 5px;
}

.input {
  width: 100%;
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-family: inherit;
  font-size: 15px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  -webkit-appearance: none;
  appearance: none;
}

.input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-light);
}

/* ---------- Mode toggle (Verein gründen / beitreten) ---------- */
.auth-mode-toggle {
  display: flex;
  border: 1px solid var(--border);
  border-radius: 7px;
  overflow: hidden;
}

.auth-mode-option {
  flex: 1;
  padding: 11px 12px;
  border: none;
  background: var(--surface);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.auth-mode-option + .auth-mode-option {
  border-left: 1px solid var(--border);
}

.auth-mode-option:hover {
  color: var(--text);
}

.auth-mode-option.active {
  color: var(--accent);
  background: var(--accent-light);
}

/* ---------- Forgot password ---------- */
.forgot-link {
  display: block;
  text-align: right;
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 7px;
  transition: color 0.15s ease;
}

.forgot-link:hover {
  color: var(--accent);
}

/* ---------- Error message ---------- */
.auth-error {
  display: none;
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  color: var(--red-text);
  font-size: 13px;
  line-height: 1.5;
  padding: 10px 14px;
  border-radius: 6px;
  margin-bottom: 16px;
}

.auth-error.auth-error--success {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-hover);
}

/* ---------- Passwort-Stärke ---------- */
.pw-strength {
  margin-top: 9px;
}

.pw-strength.hidden {
  display: none;
}

.pw-strength-bars {
  display: flex;
  gap: 5px;
}

.pw-strength-bar {
  flex: 1;
  height: 5px;
  border-radius: 3px;
  background: var(--border);
  transition: background 0.2s ease;
}

/* Level-Farben: 1 = sehr schwach … 4 = stark */
.pw-strength[data-score="1"] .pw-strength-bar[data-level="1"] { background: #DC2626; }
.pw-strength[data-score="2"] .pw-strength-bar[data-level="1"],
.pw-strength[data-score="2"] .pw-strength-bar[data-level="2"] { background: #F59E0B; }
.pw-strength[data-score="3"] .pw-strength-bar[data-level="1"],
.pw-strength[data-score="3"] .pw-strength-bar[data-level="2"],
.pw-strength[data-score="3"] .pw-strength-bar[data-level="3"] { background: #EAB308; }
.pw-strength[data-score="4"] .pw-strength-bar { background: var(--accent); }

.pw-strength-text {
  font-size: 12px;
  margin-top: 6px;
  color: var(--text-muted);
}

.pw-strength[data-score="1"] .pw-strength-text { color: #B91C1C; }
.pw-strength[data-score="2"] .pw-strength-text { color: #B45309; }
.pw-strength[data-score="3"] .pw-strength-text { color: #A16207; }
.pw-strength[data-score="4"] .pw-strength-text { color: var(--accent-hover); }

/* Sichtbarer Fokus für alle interaktiven Elemente (Accessibility) */
.btn-auth:focus-visible,
.auth-tab:focus-visible,
.auth-mode-option:focus-visible,
.forgot-link:focus-visible,
.input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Submit button ---------- */
.btn-auth {
  display: block;
  width: 100%;
  height: 44px;
  border: none;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
  margin-top: 6px;
}

.btn-auth:hover {
  background: var(--accent-hover);
}

.btn-auth:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

/* ---------- Legal text ---------- */
.auth-legal {
  margin-top: 18px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.7;
}

.auth-legal a {
  color: var(--text-secondary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-legal a:hover {
  color: var(--text);
}

/* ---------- Back link ---------- */
.auth-back {
  font-size: 14px;
}

.auth-back a {
  color: var(--text-muted);
  transition: color 0.15s ease;
}

.auth-back a:hover {
  color: var(--text-secondary);
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
  body {
    align-items: flex-start;
    overflow-y: auto;
    padding: 0;
  }

  .auth-page {
    padding: 24px 16px 48px;
    min-height: 100vh;
  }

  .auth-form {
    padding: 24px 20px;
  }

  .auth-form-head h1 {
    font-size: 21px;
  }

  .field-row {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .auth-mode-toggle {
    flex-direction: column;
    border-radius: 8px;
  }

  .auth-mode-option + .auth-mode-option {
    border-left: none;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 360px) {
  .auth-logo {
    font-size: 22px;
  }

  .input {
    font-size: 14px;
  }

  .btn-auth {
    height: 42px;
    font-size: 14px;
  }
}
