/* Anmeldung - diskret: nur Zeichen und Felder, kein Wort zum Inhalt dahinter.
   Gleiche Tokens wie das Dashboard (Tinte #0e0e0f / #1a1a1c, Text #d9d9d6, Akzent Gold).
   Formensystem: Panel 16px, Felder 10px, Knopf als Pille. */

@font-face { font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/public/fonts/InterVariable.woff2") format("woff2"); }

:root {
  color-scheme: dark;
  --page: #0e0e0f;
  --aura: rgba(209, 177, 112, 0.07);
  --surface-1: rgba(21, 21, 23, 0.86);
  --surface-2: #1a1a1c;
  --border: rgba(217, 217, 214, 0.08);
  --border-strong: rgba(217, 217, 214, 0.15);
  --text-1: #e6e6e3;
  --text-2: #b4b4b0;
  --text-3: #8a8a85;
  --accent: #d1b170;
  --accent-ink: #141414;
  --accent-wash: rgba(209, 177, 112, 0.12);
  --loss: #e5555f;
  --loss-text: #f07079;
  --loss-wash: rgba(229, 85, 95, 0.12);
  --warn: #e0a63c;
  --panel-shadow: 0 1px 0 rgba(255, 255, 255, 0.035) inset, 0 30px 60px -30px rgba(0, 0, 0, 0.75);
  --surface-3: #232326;
  --logo-shadow: drop-shadow(0 12px 26px rgba(209, 177, 112, 0.16));
  --font-ui: "Inter", "Helvetica Neue", Arial, system-ui, sans-serif;
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #e9e9e6;
  --aura: rgba(143, 109, 40, 0.07);
  --surface-1: rgba(246, 246, 243, 0.9);
  --surface-2: #eeeeeb;
  --border: rgba(15, 15, 16, 0.08);
  --border-strong: rgba(15, 15, 16, 0.16);
  --text-1: #111112;
  --text-2: #3d3d3a;
  --text-3: #5f5f59;
  --accent: #8a6826;
  --accent-ink: #f7f5ef;
  --accent-wash: rgba(138, 104, 38, 0.12);
  --loss: #c8323e;
  --loss-text: #b52c37;
  --loss-wash: rgba(200, 50, 62, 0.09);
  --warn: #9a6a00;
  --panel-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 24px 50px -30px rgba(15, 15, 16, 0.28);
  --surface-3: #e1e1dd;
  --logo-shadow: drop-shadow(0 10px 20px rgba(15, 15, 16, 0.18));
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(28px, env(safe-area-inset-top)) 20px max(28px, env(safe-area-inset-bottom));
  font-family: var(--font-ui);
  color: var(--text-1);
  background: radial-gradient(70% 40% at 50% 18%, var(--aura), transparent 72%), var(--page);
  background-attachment: fixed;
  overflow-x: clip;
}
::selection { background: var(--accent-wash); color: var(--text-1); }

.scene { width: min(380px, 100%); display: grid; justify-items: center; gap: 22px; }
.mark { width: 104px; height: 104px; }
.mark img { width: 100%; height: 100%; display: block; filter: var(--logo-shadow); }

.panel {
  width: 100%;
  padding: 26px 22px 22px;
  border-radius: 16px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  box-shadow: var(--panel-shadow);
  -webkit-backdrop-filter: saturate(140%) blur(18px);
  backdrop-filter: saturate(140%) blur(18px);
}
h1 { margin: 0 0 20px; font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }

.field { display: grid; gap: 8px; margin-bottom: 16px; }
label { font-size: 13px; font-weight: 500; color: var(--text-2); }
input[type="text"], input[type="password"] {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--text-1);
  font: 400 16px/1 var(--font-ui);  /* 16 px: kein Zoom beim Antippen auf dem iPhone */
  caret-color: var(--accent);
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}
input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
input[aria-invalid="true"] { border-color: var(--loss); box-shadow: 0 0 0 3px var(--loss-wash); }
input:-webkit-autofill, input:-webkit-autofill:hover, input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--text-1);
  -webkit-box-shadow: 0 0 0 100px var(--surface-2) inset;
  caret-color: var(--accent);
  transition: background-color 600000s 0s;
}

.pw { position: relative; }
.pw input { padding-right: 54px; }
.reveal {
  position: absolute; top: 5px; right: 5px;
  width: 40px; height: 40px; border-radius: 8px;
  display: grid; place-items: center;
  border: 0; background: transparent; color: var(--text-3); cursor: pointer;
  transition: color .15s ease, background .15s ease;
}
.reveal:hover { color: var(--text-1); background: var(--accent-wash); }
.reveal:focus-visible, .submit:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ic { width: 20px; height: 20px; flex: none; }

.hint { display: flex; align-items: center; gap: 8px; margin: 2px 0 0; font-size: 13px; color: var(--text-2); }
.hint .ic { width: 16px; height: 16px; color: var(--warn); }

.remember { display: flex; align-items: center; gap: 12px; margin: 4px 0 14px; cursor: pointer; font-size: 14px; color: var(--text-2); }
.remember input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch {
  position: relative; width: 40px; height: 24px; flex: none; border-radius: 999px;
  background: var(--surface-3); border: 1px solid var(--border-strong); transition: background .2s ease, border-color .2s ease;
}
.switch::after {
  content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--text-3); transition: transform .25s cubic-bezier(.16, 1, .3, 1), background .2s ease;
}
.remember input:checked + .switch { background: var(--accent-wash); border-color: var(--accent); }
.remember input:checked + .switch::after { transform: translateX(16px); background: var(--accent); }
.remember input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }

.error {
  display: flex; align-items: flex-start; gap: 8px;
  min-height: 20px; margin: 0 0 10px; font-size: 13.5px; line-height: 1.45; color: var(--loss-text);
}
.error .ic { width: 16px; height: 16px; margin-top: 2px; }

.submit {
  position: relative; width: 100%; height: 50px; border: 0; border-radius: 999px; cursor: pointer;
  display: grid; place-items: center;
  background: var(--accent); color: var(--accent-ink);
  font: 600 15.5px/1 var(--font-ui); letter-spacing: 0.01em;
  transition: transform .15s ease, filter .2s ease;
}
.submit:hover { filter: brightness(1.05); }
.submit:active { transform: translateY(1px) scale(0.995); }
.submit:disabled { cursor: progress; }
.submit > * { grid-area: 1 / 1; }
.spinner, .done { opacity: 0; }
.spinner {
  width: 20px; height: 20px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
}
.submit.busy .label, .submit.ok .label { opacity: 0; }
.submit.busy .spinner { opacity: 1; }
.submit.ok .done { opacity: 1; }
.error .ic.lock { color: var(--loss-text); }

.foot { margin: 0; font-size: 12.5px; color: var(--text-3); text-align: center; }

@media (prefers-reduced-motion: no-preference) {
  .mark img { animation: fade 0.9s cubic-bezier(.16, 1, .3, 1) both; }
  .panel { animation: rise .6s cubic-bezier(.16, 1, .3, 1) .12s both; }
  .foot { animation: rise .6s cubic-bezier(.16, 1, .3, 1) .22s both; }
  .submit.busy .spinner { animation: spin .8s linear infinite; }
  .panel.shake { animation: shake .32s cubic-bezier(.36, .07, .19, .97) both; }
  body.leaving .scene { transition: opacity .3s ease, transform .3s cubic-bezier(.16, 1, .3, 1); opacity: 0; transform: scale(.985); }
  @keyframes fade { from { opacity: 0; transform: scale(.94); } to { opacity: 1; transform: none; } }
  @keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
  @keyframes spin { to { transform: rotate(360deg); } }
  @keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
}

@media (max-height: 620px) {
  .scene { gap: 14px; }
  .mark { width: 80px; height: 80px; }
}
