/* Login-Seite – eigenständig (ohne Session ist nur diese CSS-Datei erreichbar) */
/* ==========================================================================
   Gemeinsame Basis (identisch in app.css und login.css – bitte synchron halten;
   login.css darf ohne Session keine weitere Datei laden).
   ========================================================================== */

:root {
  --c-bg: #fff3f8;
  --c-card: #fffdf8;
  --c-text: #2b2140;
  --c-muted: #5a4d6d;
  --c-border: #8a7ca0;
  --c-primary: #6a23b0;
  --c-primary-hover: #561b91;
  --c-pink: #ff5d8f;
  --c-yellow: #ffc233;
  --c-blue: #3fa7ff;
  --c-green: #3cc47c;
  --c-orange: #ff8a3d;
  --c-danger: #b3261e;
  --c-danger-bg: #fdeceb;
  --c-success: #136b2d;
  --c-success-bg: #e4f5e8;
  --c-focus: #1742c9;
  --radius-lg: 32px;
  --radius-md: 20px;
  --radius-sm: 14px;
  --shadow-card: 0 18px 40px rgb(106 35 176 / 16%), 0 3px 8px rgb(43 33 64 / 10%);
  --touch: 48px;
  --font: ui-rounded, "SF Pro Rounded", "Nunito", "Varela Round", system-ui, -apple-system,
    "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: 1.125rem;
  line-height: 1.5;
  color: var(--c-text);
  background-color: var(--c-bg);
  /* Konfetti: mehrere Punkt-Raster in unterschiedlichen Größen ergeben ein verstreutes Muster. */
  background-image:
    radial-gradient(circle at 20% 30%, var(--c-pink) 0 5px, transparent 6px),
    radial-gradient(circle at 70% 60%, var(--c-yellow) 0 6px, transparent 7px),
    radial-gradient(circle at 40% 80%, var(--c-blue) 0 4px, transparent 5px),
    radial-gradient(circle at 85% 15%, var(--c-green) 0 5px, transparent 6px),
    radial-gradient(circle at 55% 35%, var(--c-orange) 0 3px, transparent 4px),
    linear-gradient(160deg, #ffe3f0 0%, #fff6e0 45%, #e5f3ff 100%);
  background-size: 190px 170px, 230px 210px, 160px 190px, 270px 240px, 130px 150px, 100% 100%;
  background-attachment: fixed;
}

h1,
h2,
h3,
p {
  margin: 0;
}

button,
input {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 3px solid var(--c-focus);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #fff;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -100px;
  z-index: 100;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: var(--c-text);
  color: #fff;
  font-weight: 700;
}

.skip-link:focus {
  top: 16px;
}

/* --- Ballons (inline-SVG, rein dekorativ) ------------------------------- */

.decor {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.balloon {
  position: absolute;
  width: clamp(70px, 11vw, 130px);
  height: auto;
  animation: balloon-float 6s ease-in-out infinite alternate;
}

.balloon--left {
  left: max(-18px, 1vw);
  top: 18vh;
}

.balloon--right {
  right: max(-10px, 1.5vw);
  top: 6vh;
  animation-delay: -2s;
}

.balloon--right2 {
  right: max(-24px, 5vw);
  bottom: 4vh;
  width: clamp(60px, 9vw, 110px);
  animation-delay: -4s;
}

.balloon__string {
  fill: none;
  stroke: #9a8bb0;
  stroke-width: 2.5;
}

.balloon__body--pink { fill: var(--c-pink); }
.balloon__body--blue { fill: var(--c-blue); }
.balloon__body--yellow { fill: var(--c-yellow); }

.balloon__shine {
  fill: #fff;
  opacity: 0.45;
}

@keyframes balloon-float {
  from { transform: translateY(0) rotate(-3deg); }
  to { transform: translateY(-18px) rotate(3deg); }
}

/* --- Formulare & Buttons -------------------------------------------------- */

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field label {
  font-weight: 700;
}

.field input {
  width: 100%;
  min-height: 54px;
  padding: 10px 16px;
  border: 2px solid var(--c-border);
  border-radius: var(--radius-sm);
  background: #fff;
  font-size: 1.125rem;
}

.field input:hover {
  border-color: var(--c-primary);
}

.field input[aria-invalid="true"] {
  border-color: var(--c-danger);
  background: #fffafa;
}

.field__error {
  min-height: 0;
  color: var(--c-danger);
  font-size: 1rem;
  font-weight: 600;
}

.field__error:empty {
  display: none;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 54px;
  min-width: var(--touch);
  padding: 12px 28px;
  border: 3px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  font-size: 1.125rem;
  line-height: 1.2;
  text-align: center;
  cursor: pointer;
  transition: background-color 0.15s ease, transform 0.15s ease;
}

.button--primary {
  background: var(--c-primary);
  color: #fff;
  box-shadow: 0 4px 0 #3f1470;
}

.button--primary:hover {
  background: var(--c-primary-hover);
}

.button--primary:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 #3f1470;
}

.button--secondary {
  background: #fff;
  border-color: var(--c-primary);
  color: var(--c-primary);
}

.button--secondary:hover {
  background: #f4ebff;
}

.button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.link-button {
  min-height: var(--touch);
  min-width: var(--touch);
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--c-muted);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.link-button:hover {
  color: var(--c-text);
  background: rgb(255 255 255 / 70%);
}

.spinner {
  display: inline-block;
  width: 44px;
  height: 44px;
  border: 5px solid #eadcff;
  border-top-color: var(--c-primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ==========================================================================
   Login-Seite (login.html)
   ========================================================================== */

.login-main {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px 16px;
}

.login-card {
  width: min(480px, 100%);
  padding: 36px 28px 32px;
  border-radius: var(--radius-lg);
  background: var(--c-card);
  box-shadow: var(--shadow-card);
  outline: 3px dashed #f1a7c4;
  outline-offset: -14px;
}

.login-card__header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
  text-align: center;
}

.login-card__cake {
  width: 96px;
  height: 96px;
}

.cake__plate { fill: #e3d3f5; }
.cake__base { fill: var(--c-pink); }
.cake__cream { fill: #fff; stroke: #f1a7c4; stroke-width: 2; }
.cake__top { fill: #ffd6e5; }
.cake__candle { fill: var(--c-blue); }
.cake__flame { fill: var(--c-yellow); stroke: var(--c-orange); stroke-width: 1.5; }
.cake__sprinkle--a { fill: var(--c-yellow); }
.cake__sprinkle--b { fill: var(--c-green); }
.cake__sprinkle--c { fill: var(--c-blue); }

.login-card__title {
  font-size: clamp(1.6rem, 6vw, 2rem);
  line-height: 1.2;
  font-weight: 900;
}

.login-card__subtitle {
  color: var(--c-muted);
  font-weight: 600;
}

.login-form {
  display: grid;
  gap: 18px;
}

.password-wrap {
  position: relative;
  display: flex;
}

.password-wrap input {
  padding-right: 58px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--c-muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: #f4ebff;
  color: var(--c-primary);
}

.password-toggle[aria-pressed="true"] {
  color: var(--c-primary);
}

.password-toggle svg {
  width: 28px;
  height: 28px;
  fill: none;
  stroke: currentcolor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.password-toggle .icon-eye-off,
.password-toggle[aria-pressed="true"] .icon-eye {
  display: none;
}

.password-toggle[aria-pressed="true"] .icon-eye-off {
  display: block;
}

.login-form .button {
  width: 100%;
  margin-top: 4px;
}

.login-message {
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  background: var(--c-danger-bg);
  color: var(--c-danger);
  font-weight: 700;
}

.login-message:empty {
  display: none;
}

@media (max-width: 420px) {
  .login-main {
    padding: 16px 10px;
  }

  .login-card {
    padding: 30px 18px 26px;
    outline-offset: -10px;
  }

  .password-wrap input {
    padding-left: 12px;
  }
}
