/* ==========================================================================
   Nordstack – Anmeldung
   Setzt auf styles.css auf: Tokens, Buttons und Grundlayout kommen von dort.
   ========================================================================== */

body.auth-page { min-height: 100vh; }

.auth { display: grid; grid-template-columns: 1.05fr .95fr; min-height: 100vh; }

/* --- Linke Seite: Marke --------------------------------------------------- */
.auth-brand {
  position: relative; overflow: hidden;
  background: var(--bg-alt);
  border-right: 1px solid var(--line-soft);
  padding: clamp(2rem, 4vw, 3.5rem);
  display: flex; flex-direction: column;
}
.auth-brand::before {
  content: ""; position: absolute; inset: -20% -30% auto -20%; height: 720px; pointer-events: none;
  background:
    radial-gradient(45% 45% at 25% 30%, color-mix(in srgb, var(--accent) 20%, transparent) 0%, transparent 70%),
    radial-gradient(42% 42% at 80% 15%, color-mix(in srgb, var(--accent-2) 24%, transparent) 0%, transparent 72%);
  filter: blur(24px);
}
.auth-brand > * { position: relative; }

.auth-brand-mid { margin: auto 0; max-width: 30rem; }
.auth-brand h1 { font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -.03em; margin-bottom: 1rem; }
.auth-brand p.lead { color: var(--text-mut); font-size: 1rem; margin-bottom: 2rem; }

.auth-points { display: grid; gap: 1.05rem; }
.auth-point { display: grid; grid-template-columns: 30px 1fr; gap: .85rem; align-items: start; }
.auth-point .pico {
  width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
  font-size: .85rem; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 28%, transparent);
}
.auth-point b { display: block; font-size: .93rem; }
.auth-point span { font-size: .85rem; color: var(--text-dim); }

.auth-foot { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .8rem; color: var(--text-dim); }
.auth-foot a { color: var(--text-mut); }
.auth-foot a:hover { color: var(--accent); }

/* --- Rechte Seite: Formular ----------------------------------------------- */
.auth-main {
  padding: clamp(1.5rem, 4vw, 3rem);
  display: flex; flex-direction: column;
}
.auth-top { display: flex; align-items: center; gap: .75rem; margin-bottom: auto; }
.auth-top .theme-toggle { margin-left: auto; }
.auth-top .brand { display: none; }

.auth-box { width: min(400px, 100%); margin: auto; }
.auth-bottom { margin-top: auto; padding-top: 2rem; font-size: .82rem; color: var(--text-dim); text-align: center; }
.auth-bottom a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.step[hidden] { display: none; }
.step h2 { font-size: 1.55rem; letter-spacing: -.03em; }
.step > p.sub { color: var(--text-mut); font-size: .92rem; margin: .5rem 0 1.75rem; }

/* --- Felder --------------------------------------------------------------- */
.f { margin-bottom: 1.1rem; }
.f label { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem;
           font-size: .86rem; font-weight: 500; margin-bottom: .4rem; }
.f label .aside { font-size: .8rem; font-weight: 400; }
.f label .aside a, .linkish {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: var(--accent); font: inherit; text-decoration: underline; text-underline-offset: 2px;
}
.linkish:hover { opacity: .8; }

.f input[type="text"], .f input[type="email"], .f input[type="password"] {
  width: 100%; padding: .7rem .85rem; border-radius: 10px;
  background: var(--surface); border: 1px solid var(--line); color: var(--text);
  font-size: .95rem;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.f input::placeholder { color: var(--text-dim); }
.f input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.f input[aria-invalid="true"] { border-color: #f87171; }
.f input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px rgba(248,113,113,.22); }

.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 4.6rem; }
.pw-toggle {
  position: absolute; right: .4rem; top: 50%; transform: translateY(-50%);
  background: none; border: 0; cursor: pointer; padding: .3rem .5rem; border-radius: 7px;
  font-size: .78rem; color: var(--text-dim);
}
.pw-toggle:hover { color: var(--accent); background: var(--surface-2); }

.msg { display: block; font-size: .8rem; min-height: 1.15em; margin-top: .3rem; color: #f87171; }
.msg.hint { color: var(--text-dim); }

.caps { font-size: .8rem; color: var(--warn); margin-top: .3rem; display: none; }
.caps.an { display: block; }

.row-between { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.4rem; }
.check-inline { display: flex; align-items: center; gap: .5rem; font-size: .86rem; color: var(--text-mut); cursor: pointer; }
.check-inline input { width: 16px; height: 16px; accent-color: var(--accent); flex: none; }

/* --- Passwortstärke ------------------------------------------------------- */
.strength { margin-top: .55rem; }
.strength-bars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }
.strength-bars i { height: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line-soft); }
.strength-bars i.on-1 { background: #f87171; border-color: #f87171; }
.strength-bars i.on-2 { background: var(--warn); border-color: var(--warn); }
.strength-bars i.on-3 { background: #38bdf8; border-color: #38bdf8; }
.strength-bars i.on-4 { background: var(--ok); border-color: var(--ok); }
.strength-text { font-size: .78rem; color: var(--text-dim); margin-top: .35rem; }

/* --- Einmalcode ----------------------------------------------------------- */
.otp { display: flex; gap: .5rem; justify-content: space-between; border: 0; padding: 0; margin: 0 0 .3rem; }
.otp input {
  width: 100%; aspect-ratio: 3 / 4; min-width: 0;
  text-align: center; font-family: var(--mono); font-size: 1.4rem; font-weight: 500;
  border-radius: 11px; background: var(--surface); border: 1px solid var(--line); color: var(--text);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.otp input:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent);
}
.otp input:not(:placeholder-shown) { border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); }
.otp.falsch input { border-color: #f87171; animation: ruettel .35s ease; }
@keyframes ruettel {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.otp-mail { font-weight: 600; color: var(--text); }

/* --- Ladezustand am Knopf ------------------------------------------------- */
.btn.is-busy { pointer-events: none; opacity: .8; }
.btn.is-busy .spin {
  width: 14px; height: 14px; border-radius: 50%; flex: none;
  border: 2px solid color-mix(in srgb, currentColor 30%, transparent);
  border-top-color: currentColor;
  animation: dreh .7s linear infinite;
}
@keyframes dreh { to { transform: rotate(360deg); } }
.btn .spin { display: none; }
.btn.is-busy .spin { display: block; }

/* --- Trennlinie und SSO --------------------------------------------------- */
.trenner { display: flex; align-items: center; gap: .9rem; margin: 1.5rem 0; color: var(--text-dim); font-size: .78rem; }
.trenner::before, .trenner::after { content: ""; flex: 1; height: 1px; background: var(--line-soft); }

.sso { display: grid; gap: .5rem; }
.sso .btn { justify-content: center; gap: .6rem; }

/* --- Erfolgsmeldung ------------------------------------------------------- */
.erfolg { text-align: center; }
.erfolg .haken {
  width: 52px; height: 52px; border-radius: 50%; margin: 0 auto 1.2rem;
  display: grid; place-items: center; font-size: 1.5rem;
  color: var(--ok); background: color-mix(in srgb, var(--ok) 13%, transparent);
  border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent);
}
.erfolg h2 { margin-bottom: .6rem; }
.erfolg p { color: var(--text-mut); font-size: .92rem; margin-bottom: 1.6rem; }

/* --- Demo-Hinweis --------------------------------------------------------- */
.demo-note {
  margin-top: 1.6rem; padding: .85rem 1rem; border-radius: 11px;
  border: 1px dashed color-mix(in srgb, var(--warn) 45%, var(--line));
  background: color-mix(in srgb, var(--warn) 7%, transparent);
  font-size: .82rem; color: var(--text-mut);
}
.demo-note b { color: var(--text); display: block; margin-bottom: .25rem; }
.demo-note code {
  font-family: var(--mono); font-size: .92em;
  background: var(--surface-2); border: 1px solid var(--line-soft);
  padding: .05em .35em; border-radius: 5px; color: var(--text);
}

/* --- Responsiv ------------------------------------------------------------ */
@media (max-width: 880px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-top .brand { display: inline-flex; }
  .auth-main { min-height: 100vh; }
}

@media (max-width: 400px) {
  .otp { gap: .35rem; }
  .otp input { font-size: 1.15rem; }
}

/* Der Demo-Hinweis steht auf dem Zwei-Faktor-Schritt ueber den Code-Feldern,
   nicht wie sonst darunter. */
.demo-oben { margin-top: 0; margin-bottom: 1.6rem; }
.demo-oben .linkish { display: inline-block; }
