/* ── Auth-Standalone Design System ────────────────────────────────────────────
   Geteilt von: register.php / forgot-password.php / reset-password.php /
   verify-email.php. Klassenamen und Werte identisch mit Login-Screen
   (index.php). Standalone-spezifisch: Header + auth-wrap statt SPA-Shell.
   ─────────────────────────────────────────────────────────────────────────── */

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

:root {
  --bg:          #111f26;
  --text:        #edeade;
  --muted:       rgba(240,236,227,.62);
  --muted-aaa:   rgba(240,236,227,.45);
  --line-strong: rgba(200,225,235,.18);
  --panel:       rgba(10,24,32,.78);
  --accent:      #b58936;
  --accent-lt:   rgba(181,137,54,.15);
  --accent-green:#8da47b;
  --red:         #f28888;
}

html { min-height: 100%; } body { min-height: 100%; }

body {
  margin: 0;
  display: flex;
  flex-direction: column;
  background: #111f26 url('/assets/img/bg-topo.png') center top / cover no-repeat;
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, 'Segoe UI', sans-serif;
  overflow-y: auto;
}

/* ── Header (Abstände identisch zu .app-header in index.php) ─────────────── */

.standalone-header {
  position: sticky;
  top: 0;
  z-index: 10;
  width: 100%;
  display: flex;
  align-items: center;
  gap: .75rem;
  padding: max(env(safe-area-inset-top), 1rem) 1.25rem .75rem;
  flex-shrink: 0;
  background: rgba(10,24,32,.6);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}
.standalone-header .standalone-spacer { flex: 1; }
.standalone-header .profile-chip {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(10,24,32,.55); border: 1px solid var(--line-strong);
  color: var(--text); font-size: .78rem; font-weight: 600;
  height: 32px; box-sizing: border-box;
  padding: 0 .75rem; border-radius: 20px; cursor: pointer;
  backdrop-filter: blur(12px); transition: background .15s;
  font-family: inherit; max-width: min(160px, 40vw);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  text-decoration: none;
}
.standalone-header .profile-chip:hover { background: rgba(10,24,32,.75); }
.standalone-header .profile-chip.guest { color: var(--muted-aaa); }

.standalone-header .btn-back {
  width: 36px; height: 36px; flex: none;
  display: flex; align-items: center; justify-content: center;
  background: var(--panel);
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  color: var(--text); cursor: pointer; padding: 0;
}
.standalone-header .btn-back:hover { background: rgba(255,255,255,.06); }
.standalone-header .btn-back svg { display: block; flex-shrink: 0; }
.standalone-header .standalone-logo { height: 22px; }

/* ── Zentrierender Wrapper (entspricht #screen-login.screen.active) ─────── */

.auth-wrap {
  flex: 1;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.75rem;
}

/* ── Formular-Grid (identisch mit #login-form in index.php) ─────────────── */

.auth-form {
  width: 100%;
  display: grid;
  grid-template-columns: 1fr;
  grid-template-areas: "core" "main" "actions";
  align-items: center; justify-items: center; justify-content: center;
  text-align: center; gap: 1.25rem;
}

/* ── Komponenten (exakt aus index.php) ───────────────────────────────────── */

.login-core {
  grid-area: core;
  width: 100%;
  display: flex; flex-direction: column; align-items: center; gap: 1.25rem;
}

.login-title { font-size: 1.2rem; font-weight: 700; margin: 0; }
.login-sub   { color: var(--muted); font-size: .88rem; margin: 0; }

.login-input {
  width: 100%; max-width: 280px;
  background: rgba(255,255,255,.06);
  border: 1px solid var(--line-strong); border-radius: 12px;
  color: var(--text); font-size: .95rem; padding: .75rem 1rem;
  font-family: inherit; outline: none; box-sizing: border-box;
}
.login-input:focus       { border-color: var(--accent); }
.login-input:read-only   { color: var(--muted); cursor: default; }
.login-input:read-only:focus { border-color: var(--line-strong); }

.login-error { color: var(--red); font-size: .85rem; margin: 0; min-height: 1.2em; }
.login-ok    { color: var(--accent-green); font-size: .85rem; margin: 0; min-height: 1.2em; }

/* Turnstile im Flex-Container zentrieren + Overflow des Fehler-Widgets kappen */
.cf-turnstile { width: 100%; max-width: 280px; overflow: hidden; }

/* .btn-start-big hat margin:0 auto, das zentriert den 230px-Button in 280px
   und verschiebt ihn 25px rechts vom Sekundär-Button-Block. display:flex +
   margin:0 auf dem Button behebt das: Button füllt die volle Breite,
   Pfeil überragt den Container rechts (position:absolute, gewollt). */
.login-main    { grid-area: main;    width: 100%; max-width: 280px; display: flex; align-items: stretch; }
.login-main .btn-start-arrow { margin: 0; }
.login-actions { grid-area: actions; width: 100%; max-width: 280px; display: flex; flex-direction: column; gap: 1rem; }
.login-actions .btn-next { width: 100%; }

.login-oauth-row { display: flex; gap: .6rem; }
.btn-oauth {
  flex: 1; display: flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .55rem .5rem; border: 1px solid rgba(255,255,255,.13); border-radius: 10px;
  background: rgba(255,255,255,.04); color: var(--text); text-decoration: none;
  font-size: .85rem; font-weight: 500; transition: background .15s;
}
.btn-oauth:hover { background: rgba(255,255,255,.09); }
.btn-oauth svg   { flex-shrink: 0; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.btn-start-big {
  display: flex; align-items: center; justify-content: center; gap: .6rem;
  width: 100%; max-width: 320px;
  background: var(--accent-green); color: #07110d;
  border: 3px solid #163028; border-radius: 19px;
  min-height: 58px; padding: 1rem 1.25rem;
  font-size: 1.1rem; font-weight: 750; cursor: pointer;
  transition: background .15s, opacity .15s, transform .1s;
  letter-spacing: .01em; font-family: inherit; white-space: nowrap;
  margin: 0 auto; text-decoration: none;
}
.btn-start-big:hover  { background: color-mix(in srgb, var(--accent-green) 85%, var(--bg) 15%); }
.btn-start-big:active { background: color-mix(in srgb, var(--accent-green) 75%, var(--bg) 25%); transform: scale(.97); }

.btn-start-arrow {
  border-radius: 19px 0 0 19px; position: relative;
  width: calc(100% - 50px);
}
.btn-start-arrow::before,
.btn-start-arrow::after {
  content: ''; position: absolute; left: calc(100% + 6px);
  clip-path: polygon(0% 0%, 45% 0%, 88% 38%, 100% 50%, 88% 62%, 45% 100%, 0% 100%);
}
.btn-start-arrow::before { top: -3px; bottom: -3px; width: 44px; background: #163028; }
.btn-start-arrow::after  { top: 0;    bottom: 0;    width: 41px; background: #b58936; }

.btn-next {
  display: block; width: 100%;
  background: rgba(255,255,255,.018); color: var(--text);
  border: 1px solid var(--line-strong); border-radius: 18px;
  min-height: 50px; padding: .85rem 1.25rem;
  font-size: .98rem; font-weight: 600; cursor: pointer;
  transition: background .15s; font-family: inherit;
  text-align: center; text-decoration: none; box-sizing: border-box;
}
.btn-next:hover { background: rgba(255,255,255,.045); }

/* ── Landscape: identisch zu #login-form in index.php ───────────────────── */

@media (orientation: landscape) and (max-height: 500px) {
  .auth-wrap { padding: .75rem 1.5rem; }
  .auth-form {
    grid-template-columns: 42% 1fr;
    grid-template-areas: "main core" "main actions";
    gap: 1.25rem 1.5rem;
  }
  .login-main { max-width: none; justify-self: center; }
  .login-core, .login-actions { max-height: 100%; overflow-y: auto; }
}
