/* =========================================================
   ALSBOBECH LOGIN
   Samme designsystem som AlsboBech.dk: varm off-white flade med
   gitter og bløde glows, mørk brandflade med lilla/blå som eneste farve.
   Opbygget som et samlet split-kort midt på siden.
   ========================================================= */

:root {
  --bg: #f4f3ef;
  --bg-2: #eceae4;
  --surface: #ffffff;
  --field: #f7f6f2;
  --ink: #0e0e10;
  --ink-2: #18181c;
  --muted: #64646b;
  --line: rgba(14, 14, 16, .1);
  --line-light: rgba(255, 255, 255, .12);
  --accent: #6c5ce7;
  --accent-2: #4facfe;
  --gradient: linear-gradient(120deg, var(--accent), var(--accent-2));
  --danger: #c62828;
  --ok: #1b7f3b;

  --display: "Space Grotesk", system-ui, sans-serif;
  --sans: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;

  --radius: 28px;
  --radius-sm: 14px;
  --ease: cubic-bezier(.2, .7, .1, 1);
  --shadow: 0 1px 2px rgba(14, 14, 16, .05), 0 24px 48px -16px rgba(14, 14, 16, .18), 0 60px 120px -40px rgba(60, 50, 140, .28);
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; min-height: 100vh; min-height: 100dvh;
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
button, input { font: inherit; color: inherit; }
h1, h2, p, ul { margin: 0; }
ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
::selection { background: var(--accent); color: #fff; }

/* ---------- Baggrund (som heroen på alsbobech.dk) ---------- */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.backdrop::before {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(var(--line) 1px, transparent 1px), linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 15%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 45%, #000 15%, transparent 75%);
  opacity: .6;
}
.blob { position: absolute; border-radius: 50%; filter: blur(80px); opacity: .55; }
.blob-a { width: 560px; height: 560px; right: -140px; top: -160px; background: #b8b0ff; animation: drift 18s ease-in-out infinite alternate; }
.blob-b { width: 460px; height: 460px; left: -120px; bottom: -160px; background: #a8dcff; animation: drift 22s ease-in-out infinite alternate-reverse; }
@keyframes drift { to { transform: translate(-60px, 40px) scale(1.1); } }

/* ---------- Typografi ---------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font: 500 12px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
}
.eyebrow .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gradient); box-shadow: 0 0 0 4px rgba(108, 92, 231, .15); }

.title, .brand-title { font-family: var(--display); font-weight: 600; letter-spacing: -.035em; }
.title { font-size: clamp(34px, 4.2vw, 44px); line-height: 1; margin-top: 16px; }
.title em {
  font-style: normal;
  background: var(--gradient); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.lede { margin-top: 12px; color: var(--muted); max-width: 40ch; }

/* ---------- Layout ---------- */
.page {
  min-height: 100vh; min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 24px;
  padding: 40px 32px 28px;
}
.shell {
  width: 100%; max-width: 1040px;
  display: grid; grid-template-columns: 1fr 1.08fr;
  background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow);
  overflow: hidden; isolation: isolate;
  animation: rise .8s var(--ease) both;
}
@keyframes rise { from { opacity: 0; transform: translateY(18px) scale(.985); } }

/* ---------- Brandflade ---------- */
.brand-panel {
  position: relative; overflow: hidden; isolation: isolate;
  background: var(--ink); color: #fff;
  padding: 44px 44px 48px;
  display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 32px;
  text-align: center;
}
.brand-panel::before { /* svagt gitter i det mørke */
  content: ""; position: absolute; inset: 0; z-index: -1;
  background-image: linear-gradient(var(--line-light) 1px, transparent 1px), linear-gradient(90deg, var(--line-light) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(circle at 50% 42%, #000 0, transparent 62%);
  -webkit-mask-image: radial-gradient(circle at 50% 42%, #000 0, transparent 62%);
  opacity: .5;
}
.brand-glow {
  position: absolute; z-index: -1; inset: 0; pointer-events: none;
  background:
    radial-gradient(circle at 15% 0%, rgba(108, 92, 231, .55), transparent 45%),
    radial-gradient(circle at 100% 100%, rgba(79, 172, 254, .35), transparent 45%),
    radial-gradient(circle at 50% 42%, rgba(108, 92, 231, .3), transparent 38%);
}

.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font: 600 20px/1 var(--display); letter-spacing: -.02em; }

/* Grafik: tre svævende lag (glas, gradient, stiplet) set isometrisk */
.layers { position: relative; width: min(280px, 72%); aspect-ratio: 1; margin-top: 12px; }
.layers-glow {
  position: absolute; inset: 18%; border-radius: 50%;
  background: radial-gradient(circle, rgba(108, 92, 231, .7), rgba(79, 172, 254, .25) 50%, transparent 72%);
  filter: blur(30px); animation: pulse 6s ease-in-out infinite;
}
.layer {
  position: absolute; left: 15%; top: 15%; width: 70%; height: 70%; border-radius: 26px;
  transform: rotateX(58deg) rotateZ(-45deg);
  animation: hover 7s ease-in-out infinite;
}
.layer-1 { /* nederst: stiplet omrids */
  top: 40%; border: 1.5px dashed rgba(255, 255, 255, .3);
  animation-delay: -1.4s;
}
.layer-2 { /* midten: glas med svage linjer */
  top: 18%; display: grid; align-content: center; gap: 10%; padding: 0 16%;
  background: linear-gradient(135deg, rgba(255, 255, 255, .14), rgba(255, 255, 255, .03));
  border: 1px solid rgba(255, 255, 255, .22);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .25), 0 30px 60px -20px rgba(0, 0, 0, .6);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  animation-delay: -.7s;
}
.layer-2 i { display: block; height: 7px; border-radius: 6px; background: rgba(255, 255, 255, .22); }
.layer-2 i:nth-child(1) { width: 70%; }
.layer-2 i:nth-child(2) { width: 100%; opacity: .6; }
.layer-2 i:nth-child(3) { width: 45%; background: var(--gradient); opacity: .9; }
.layer-3 { /* øverst: gradient */
  top: -6%;
  background: linear-gradient(135deg, #8b7dff, var(--accent) 45%, var(--accent-2));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -20px 40px rgba(14, 14, 16, .15), 0 40px 70px -20px rgba(108, 92, 231, .8);
}
.spark { position: absolute; border-radius: 50%; background: #fff; animation: twinkle 4s ease-in-out infinite; }
.spark-a { width: 6px; height: 6px; left: 8%; top: 22%; }
.spark-b { width: 4px; height: 4px; right: 6%; top: 52%; background: var(--accent-2); animation-delay: -1.3s; }
.spark-c { width: 5px; height: 5px; left: 26%; bottom: 6%; background: #b8b0ff; animation-delay: -2.6s; }
@keyframes hover { 50% { translate: 0 -10px; } }
@keyframes pulse { 50% { opacity: .65; scale: 1.08; } }
@keyframes twinkle { 50% { opacity: .2; scale: .6; } }

.brand-copy { display: grid; justify-items: center; gap: 10px; }
.brand-title { font-size: 26px; line-height: 1.1; }
.brand-lede { color: rgba(255, 255, 255, .64); font-size: 15px; max-width: 34ch; }
.brand-copy .btn { margin-top: 10px; }

/* ---------- Formularflade ---------- */
.form-panel {
  display: flex; flex-direction: column; justify-content: center;
  padding: 56px clamp(40px, 5vw, 72px);
  min-height: 700px;
}
.step.is-active { animation: step-in .45s var(--ease); }
@keyframes step-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Felter ---------- */
form { margin-top: 28px; display: grid; gap: 16px; }
.field { display: grid; gap: 8px; }
.field-label { font-size: 13px; font-weight: 600; }
.field-hint { font-size: 13px; color: #a15c00; }

.input-wrap {
  display: flex; align-items: center;
  background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-sm);
  transition: border-color .2s, background .2s, box-shadow .2s;
}
.input-wrap:hover { border-color: rgba(14, 14, 16, .2); }
.input-wrap:focus-within { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 4px rgba(108, 92, 231, .14); }
.input-wrap.is-invalid { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(198, 40, 40, .1); }
.input-icon {
  flex: none; width: 18px; height: 18px; margin-left: 16px;
  fill: none; stroke: #9a9aa2; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
  transition: stroke .2s;
}
.input-wrap:focus-within .input-icon { stroke: var(--accent); }
.input-wrap input {
  flex: 1; min-width: 0; border: 0; background: none; outline: none;
  padding: 14px 16px 14px 12px; font-size: 16px; /* 16px undgår zoom på iOS */
}
/* Skjul datalist-pilen ved Domæne; forslag vises stadig, når man skriver */
.input-wrap input::-webkit-calendar-picker-indicator { display: none !important; opacity: 0; }
.input-wrap input::placeholder { color: #a3a3aa; }
.reveal-btn {
  border: 0; background: none; cursor: pointer; padding: 8px 12px; margin-right: 6px;
  font-size: 13px; font-weight: 600; color: var(--muted); border-radius: 8px;
}
.reveal-btn:hover { color: var(--ink); background: rgba(14, 14, 16, .05); }

/* 6 kodefelter. Det rigtige input ligger usynligt oven på, så autoudfyld og indsæt virker. */
.code-wrap { position: relative; display: block; }
.code-input {
  position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1;
  border: 0; background: none; outline: none; padding: 0;
  color: transparent; caret-color: transparent; font-size: 16px; letter-spacing: 0;
}
.code-input::selection { background: transparent; }
.code-cells { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.code-cells i {
  display: grid; place-items: center; height: 60px; font-style: normal;
  background: var(--field); border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: 600 26px/1 var(--display); color: var(--ink);
  transition: border-color .2s, box-shadow .2s, background .2s, transform .25s var(--ease);
}
.code-cells i.is-filled { background: var(--surface); transform: translateY(-1px); }
.code-cells i.is-current { border-color: var(--accent); background: var(--surface); box-shadow: 0 0 0 4px rgba(108, 92, 231, .14); }
.code-cells i.is-current:empty::after { content: ""; width: 2px; height: 26px; background: var(--accent); animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.code-wrap.is-invalid .code-cells i { border-color: var(--danger); }
@media (max-width: 400px) { .code-cells { gap: 6px; } .code-cells i { height: 52px; font-size: 22px; } }

.status { font-size: 14px; font-weight: 500; }
.status:empty { display: none; }
.status.is-error { color: var(--danger); }
.status.is-ok { color: var(--ok); }

/* ---------- Knapper ---------- */
.btn {
  --btn-bg: var(--ink); --btn-fg: #fff;
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 0 26px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  background: var(--btn-bg); color: var(--btn-fg); text-decoration: none; white-space: nowrap;
  font: 600 15px/1 var(--sans);
  transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .3s, opacity .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 26px -10px rgba(108, 92, 231, .65); }
.btn:active { transform: none; }
.btn-arrow { display: inline-block; transition: transform .4s var(--ease); }
.btn:hover .btn-arrow { transform: translateX(4px); }
.btn-block { width: 100%; margin-top: 6px; }
.btn[disabled] { cursor: progress; opacity: .85; }
.btn-ghost-light { --btn-bg: transparent; --btn-fg: #fff; border-color: rgba(255, 255, 255, .22); min-height: 48px; }
.btn-ghost-light:hover { border-color: rgba(255, 255, 255, .6); box-shadow: none; background: rgba(255, 255, 255, .06); }

.spinner {
  display: none; width: 18px; height: 18px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff; animation: spin .8s linear infinite;
}
.btn.is-loading .spinner { display: block; }
.btn.is-loading .btn-arrow { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

.back, .link-btn {
  border: 0; background: none; padding: 0; cursor: pointer;
  font-size: 14px; font-weight: 600; color: var(--muted);
}
.back { display: flex; width: fit-content; margin-bottom: 22px; }
.back:hover, .link-btn:hover { color: var(--ink); }
.link-btn { color: var(--accent); }

.help { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.help a { color: var(--ink); font-weight: 600; text-underline-offset: 3px; }
.help-new { display: none; }

/* ---------- 2FA-opsætning ---------- */
.qr {
  margin: 24px 0 20px; padding: 20px; border-radius: 20px; background: var(--field); border: 1px solid var(--line);
  display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center;
}
.qr img { width: 140px; height: 140px; border-radius: 12px; padding: 6px; background: #fff; box-shadow: 0 6px 18px -8px rgba(14, 14, 16, .25); }
.qr-secret { display: grid; gap: 8px; justify-items: start; min-width: 0; }
.qr-secret .field-label { font-weight: 500; color: var(--muted); }
.qr-secret code {
  max-width: 100%; font: 500 14px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .08em;
  background: var(--surface); border: 1px solid var(--line); padding: 8px 12px; border-radius: 10px; word-break: break-all;
}
@media (max-width: 480px) {
  .qr { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .qr img { width: 180px; height: 180px; }
  .qr-secret { justify-items: center; }
}

/* ---------- Færdig ---------- */
.step-done { display: grid; justify-items: center; text-align: center; }
.step-done .lede { margin-inline: auto; }
.step-done .title { margin-top: 28px; }
.done-mark {
  width: 72px; height: 72px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gradient); box-shadow: 0 0 0 10px rgba(108, 92, 231, .12), 0 16px 40px -10px rgba(108, 92, 231, .7);
  animation: pop .55s var(--ease);
}
.done-mark svg { width: 34px; height: 34px; fill: none; stroke: #fff; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; animation: draw .45s .25s var(--ease) forwards; }
.done-bar { width: 160px; height: 4px; margin-top: 28px; border-radius: 4px; background: var(--bg-2); overflow: hidden; }
.done-bar span { display: block; height: 100%; background: var(--gradient); animation: load .9s var(--ease) forwards; transform-origin: left; transform: scaleX(0); }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes load { to { transform: scaleX(1); } }

.foot { font-size: 13px; color: var(--muted); }
.foot a { text-underline-offset: 3px; }

/* ---------- Mobil og tablet: bånd foroven, formular på hvidt ---------- */
@media (max-width: 879px) {
  .page { padding: 0; gap: 0; justify-content: flex-start; }
  .shell {
    grid-template-columns: 1fr; max-width: none; flex: 1;
    border-radius: 0; box-shadow: none; animation: none;
    grid-template-rows: auto 1fr;
  }
  .brand-panel {
    flex-direction: row; justify-content: flex-start; text-align: left;
    padding: 22px 16px; min-height: 104px; padding-top: max(22px, env(safe-area-inset-top));
  }
  .brand { font-size: 19px; }
  .brand-copy { display: none; }
  .layers { position: absolute; width: 190px; right: -30px; top: 50%; translate: 0 -36%; margin: 0; }
  .form-panel { min-height: 0; padding: 36px 16px 32px; justify-content: flex-start; }
  .help-new { display: block; margin-top: 12px; padding-top: 0; border-top: 0; }
  .foot { padding: 20px 16px max(20px, env(safe-area-inset-bottom)); text-align: center; background: var(--surface); width: 100%; border-top: 1px solid var(--line); }
}
@media (min-width: 560px) and (max-width: 879px) {
  .form-panel { padding: 56px 32px; align-items: center; }
  .form-panel .step { width: 100%; max-width: 440px; }
  .brand-panel { padding-inline: 32px; }
}

/* ---------- 404 ---------- */
.page-404 .page { padding: 16px; }
.lost {
  max-width: 480px; width: 100%; padding: 40px; border-radius: var(--radius);
  background: var(--surface); box-shadow: var(--shadow);
  display: grid; gap: 4px; justify-items: start;
}
.lost .btn { margin-top: 24px; }
.noscript { position: fixed; bottom: 16px; left: 16px; right: 16px; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: 12px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .done-mark svg { stroke-dashoffset: 0; }
  .done-bar span { transform: none; }
}
