/* ==========================================================================
   login.css — Anmelde- und Passwort-Seiten (Streunerkatzenhilfe)
   Eigenständig lauffähig, keine Abhängigkeit von einer weiteren CSS-Datei.
   ========================================================================== */

:root {
  --bg: #f8e9d8;
  --surface: #ffffff;
  --surface-alt: #fdf6ec;
  --purple: #a6538d;
  --purple-dark: #8b4576;
  --purple-soft: #f5e4ef;
  --orange: #ea8c4f;
  --orange-dark: #d8763a;
  --ink: #2e2620;
  --ink-muted: #746a5e;
  --border: #eedfc7;
  --border-strong: #e3cda3;
  --danger: #c1543f;
  --danger-soft: #f7e0da;
  --success: #6f8f5a;
  --success-soft: #e7efdd;
  --focus-ring: #8b4576;

  --font-display: "Permanent Marker", "Segoe Print", cursive;
  --font-heading: "Baloo 2", "Segoe UI", sans-serif;
  --font-body: "Nunito", "Segoe UI", sans-serif;

  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-pill: 999px;
  --shadow-sm: 0 2px 8px rgba(46, 38, 32, 0.08);
  --shadow-md: 0 10px 28px rgba(46, 38, 32, 0.12);
  --shadow-lg: 0 22px 48px rgba(46, 38, 32, 0.18);
  --transition: 180ms ease;
}

[data-theme="dark"] {
  --bg: #1e1812;
  --surface: #29211a;
  --surface-alt: #322820;
  --purple: #d98cbd;
  --purple-dark: #f0aad6;
  --purple-soft: #3a2732;
  --orange: #f0a05f;
  --orange-dark: #f7b87c;
  --ink: #f5ead9;
  --ink-muted: #c3b39a;
  --border: #4a3c2c;
  --border-strong: #5c4a34;
  --danger: #e0917f;
  --danger-soft: #3c2620;
  --success: #9cc084;
  --success-soft: #2b3524;
  --focus-ring: #f0aad6;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 10px 28px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 22px 48px rgba(0, 0, 0, 0.5);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    --bg: #1e1812; --surface: #29211a; --surface-alt: #322820;
    --purple: #d98cbd; --purple-dark: #f0aad6; --purple-soft: #3a2732;
    --orange: #f0a05f; --orange-dark: #f7b87c; --ink: #f5ead9; --ink-muted: #c3b39a;
    --border: #4a3c2c; --border-strong: #5c4a34; --danger: #e0917f; --danger-soft: #3c2620;
    --success: #9cc084; --success-soft: #2b3524; --focus-ring: #f0aad6;
  }
}

* , *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font-body); background: var(--bg); color: var(--ink);
  transition: background var(--transition), color var(--transition); -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; }
.icon { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.icon-fill { fill: currentColor; stroke: none; }
:focus-visible { outline: 2.5px solid var(--focus-ring); outline-offset: 2px; border-radius: 4px; }

.skip-link { position: absolute; left: -999px; top: 0; background: var(--purple); color: #fff; padding: 10px 18px; border-radius: 0 0 10px 0; z-index: 300; }
.skip-link:focus { left: 0; }

/* -------------------- Layout -------------------- */
.auth-shell { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } .auth-visual { display: none; } }

.auth-top-actions { position: fixed; top: 18px; right: 18px; z-index: 60; display: flex; gap: 8px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--border);
  background: var(--surface); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; cursor: pointer;
}
.icon-btn:hover { background: var(--surface-alt); }

.auth-visual {
  position: relative; overflow: hidden; background: linear-gradient(135deg, var(--purple), var(--orange-dark));
  color: #fff; padding: 40px 48px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-visual::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='90'%3E%3Cg fill='%23fff' opacity='0.1'%3E%3Cellipse cx='45' cy='55' rx='11' ry='9'/%3E%3Cellipse cx='31' cy='38' rx='5' ry='6.5'/%3E%3Cellipse cx='44' cy='31' rx='5' ry='6.5'/%3E%3Cellipse cx='57' cy='38' rx='5' ry='6.5'/%3E%3C/g%3E%3C/svg%3E");
}
.auth-visual-top { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; font-family: var(--font-heading); font-weight: 700; font-size: 1.15rem; }
.auth-visual-top .brand-mark { width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.2); display: flex; align-items: center; justify-content: center; }
.auth-visual-mid { position: relative; z-index: 1; }
.auth-visual-mid h1 { font-family: var(--font-display); font-weight: 400; line-height: 1.05; font-size: clamp(2rem, 1.5rem + 2vw, 3rem); margin: 0 0 14px; transform: rotate(-1deg); }
.auth-visual-mid p { max-width: 40ch; opacity: 0.92; margin: 0; }
.auth-visual-bottom { position: relative; z-index: 1; font-size: 0.78rem; opacity: 0.85; }

.auth-form-panel { display: flex; align-items: center; justify-content: center; padding: 48px 24px; background: var(--bg); min-height: 100vh; }
.auth-form-card { width: 100%; max-width: 400px; }
.auth-mobile-brand { display: none; align-items: center; justify-content: center; gap: 10px; margin-bottom: 22px; font-family: var(--font-heading); font-weight: 700; font-size: 1.1rem; }
.auth-mobile-brand .brand-mark { width: 34px; height: 34px; border-radius: 50%; background: var(--purple-soft); color: var(--purple); display: flex; align-items: center; justify-content: center; }
@media (max-width: 900px) { .auth-mobile-brand { display: flex; } }

.auth-form-header { text-align: left; margin-bottom: 22px; }
.auth-form-header h2 { font-family: var(--font-heading); font-weight: 700; font-size: 1.5rem; margin: 0 0 6px; }
.auth-form-header p { margin: 0; color: var(--ink-muted); font-size: 0.9rem; }

form { margin: 0; }
#login-form, #forgot-form, #reset-form { display: flex; flex-direction: column; gap: 18px; }

/* -------------------- Formularfelder -------------------- */
.form-field label { display: block; font-family: var(--font-heading); font-weight: 700; font-size: 0.82rem; margin-bottom: 6px; }
.input-with-icon { position: relative; display: flex; align-items: center; }
.input-with-icon > .icon { position: absolute; left: 14px; width: 17px; height: 17px; color: var(--ink-muted); pointer-events: none; }
.input-with-icon input {
  width: 100%; padding: 11px 14px 11px 40px; border-radius: var(--radius-sm);
  border: 1.5px solid var(--border-strong); background: var(--surface-alt); color: var(--ink); font-family: var(--font-body); font-size: 0.9rem;
}
.input-with-icon input:focus { outline: none; border-color: var(--purple); }
.password-field input { padding-right: 42px; }
.password-toggle {
  position: absolute; right: 8px; background: none; border: none; cursor: pointer; color: var(--ink-muted);
  display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%;
}
.password-toggle:hover { background: var(--surface); color: var(--ink); }
.password-toggle .icon { width: 17px; height: 17px; }

.checkbox-field { display: inline-flex; align-items: center; gap: 9px; cursor: pointer; font-size: 0.85rem; user-select: none; }
.checkbox-field input[type="checkbox"] {
  appearance: none; -webkit-appearance: none; width: 20px; height: 20px; flex-shrink: 0;
  border: 1.5px solid var(--border-strong); border-radius: 6px; background: var(--surface-alt); cursor: pointer; position: relative; margin: 0;
}
.checkbox-field input[type="checkbox"]:checked { background: var(--purple); border-color: var(--purple); }
.checkbox-field input[type="checkbox"]:checked::after {
  content: ""; position: absolute; left: 6px; top: 2px; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}

.auth-row-between { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: -4px; }
.link-btn, .link-a { background: none; border: none; padding: 0; cursor: pointer; color: var(--purple-dark); font-family: var(--font-heading); font-weight: 700; font-size: 0.82rem; text-decoration: underline; text-underline-offset: 3px; }
.link-btn:hover, .link-a:hover { color: var(--purple); }

/* -------------------- Buttons -------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px; border-radius: var(--radius-pill); font-family: var(--font-heading); font-weight: 700;
  font-size: 0.82rem; letter-spacing: 0.04em; text-transform: uppercase; border: 1.5px solid var(--border-strong);
  background: var(--surface); color: var(--ink); cursor: pointer; transition: transform var(--transition), background var(--transition), box-shadow var(--transition);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); }
.btn-primary { background: var(--purple); border-color: var(--purple); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--purple-dark); border-color: var(--purple-dark); box-shadow: var(--shadow-md); }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.7; cursor: default; transform: none; }
.spinner { width: 15px; height: 15px; border: 2px solid rgba(255,255,255,0.4); border-top-color: #fff; border-radius: 50%; animation: skh-spin 650ms linear infinite; }
@keyframes skh-spin { to { transform: rotate(360deg); } }

/* -------------------- Meldungen -------------------- */
.alert { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-sm); font-size: 0.86rem; margin-bottom: 18px; }
.alert .icon { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }
.alert-error { background: var(--danger-soft); color: var(--danger); border: 1px solid var(--danger); }
.alert-success { background: var(--success-soft); color: var(--success); border: 1px solid var(--success); }

.auth-footnote { text-align: center; margin: 22px 0 0; font-size: 0.82rem; color: var(--ink-muted); }
.auth-footnote a { color: var(--purple-dark); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
