/*
 * Login and consent page for the remote connectors of Chapuis Advisory.
 * Brand Werkplan (03_references/brand/brand-guidelines.md), web values of website v8
 * (.claude/skills/landing-page-build/references/design-system.md, section 1):
 * titles Source Serif 4 Regular, labels and buttons IBM Plex Sans in sentence case,
 * one brass spot per view (the main button, ink text on it), errors in ink with a 2 px border,
 * no red, no blue, no gradients, no dark areas.
 */
@font-face {
  font-family: "Titelschrift";
  src: url("/schriften/IBMPlexSans_wdth_wght.woff2") format("woff2");
  font-weight: 100 700;
  font-display: swap;
}
@font-face {
  font-family: "Textschrift";
  src: url("/schriften/SourceSerif4_opsz_wght.woff2") format("woff2");
  font-weight: 200 900;
  font-display: swap;
}

:root {
  --grund: #f0ede5;
  --flaeche: #e4dfd4;
  --linie: #cac2b1;
  --tinte: #22252a;
  --leise: #59554d;
  --messing: #b8913a;
  --weiss: #ffffff;
  --sans: "Titelschrift", "IBM Plex Sans", Arial, sans-serif;
  --serif: "Textschrift", "Source Serif 4", Georgia, serif;
  --motion-snap: 120ms ease-out;
  --motion-smooth: 260ms cubic-bezier(0.4, 0, 0.2, 1);
  --motion-slow: 640ms cubic-bezier(0.2, 0, 0, 1);
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--grund);
  color: var(--tinte);
  font-family: var(--serif);
  font-size: max(17px, 1rem);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- frame: plan sheet with a quiet side panel ---------- */

.blatt {
  display: grid;
  grid-template-columns: minmax(320px, 5fr) 7fr;
  min-height: 100vh;
  min-height: 100dvh;
}

.seitenfeld {
  background: var(--flaeche);
  padding: 48px 56px;
  display: flex;
  flex-direction: column;
  gap: 40px;
  border-right: 1px solid var(--linie);
}

.logo {
  display: block;
  width: 168px;
  height: auto;
}

.seitenfeld h1 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: auto 0 0;
  text-wrap: balance;
  max-width: 14ch;
}

.seitenfeld .unterzeile {
  margin: 0;
  color: var(--leise);
  max-width: 34ch;
  text-wrap: pretty;
}

/* Steps as words ("Schritt 1"), never in circles. The current one in ink with a 2 px ink bar. */
.schritte {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2px;
  font-family: var(--sans);
  font-size: max(15px, 0.8rem);
}

.schritte li {
  display: grid;
  grid-template-columns: 80px 1fr;
  padding: 10px 0 10px 14px;
  color: var(--leise);
  border-left: 2px solid transparent;
  transition: color var(--motion-smooth), border-color var(--motion-smooth);
}

.schritte li[aria-current="step"] {
  color: var(--tinte);
  border-left-color: var(--tinte);
}

.schritte li.erledigt {
  color: var(--tinte);
}

.schritte .nr {
  color: inherit;
  opacity: 0.8;
}

.fuss {
  margin-top: auto;
  font-family: var(--sans);
  font-size: 13px;
  color: var(--leise);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

/* ---------- working area ---------- */

.arbeitsfeld {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
}

.ansichten {
  width: 100%;
  max-width: 420px;
}

.abstand {
  margin-top: 16px;
}

.ansicht h2 {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(1.7rem, 2.4vw, 2.2rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  margin: 0 0 12px;
  text-wrap: balance;
}

.ansicht p {
  margin: 0 0 24px;
  text-wrap: pretty;
}

.leise {
  color: var(--leise);
}

.etikett {
  display: block;
  font-family: var(--sans);
  font-size: max(15px, 0.8rem);
  color: var(--leise);
  margin: 0 0 8px;
}

input[type="email"] {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  font-family: var(--serif);
  font-size: 18px;
  color: var(--tinte);
  background: var(--weiss);
  border: 1px solid var(--leise);
  border-radius: 8px;
  transition: border-color var(--motion-snap), box-shadow var(--motion-snap);
}

input:focus-visible {
  outline: none;
  border-color: var(--tinte);
  box-shadow: 0 0 0 2px var(--tinte);
}

/* ---------- six-digit code ---------- */

.code {
  display: grid;
  grid-template-columns: repeat(var(--code-laenge, 8), 1fr);
  gap: 8px;
  margin: 0 0 8px;
  padding: 0;
  border: 0;
  min-inline-size: 0;
}

.code input {
  width: 100%;
  aspect-ratio: 4 / 5;
  min-height: 48px;
  padding: 0;
  text-align: center;
  font-family: var(--sans);
  font-size: 24px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--tinte);
  background: var(--weiss);
  border: 1px solid var(--leise);
  border-radius: 8px;
  caret-color: var(--tinte);
  transition: border-color var(--motion-snap), box-shadow var(--motion-snap), transform var(--motion-snap);
}

.code input:not(:placeholder-shown) {
  border-color: var(--tinte);
}

.code.falsch input {
  border-color: var(--tinte);
  box-shadow: 0 0 0 2px var(--tinte);
}

.code-zeile {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin: 12px 0 0;
  font-family: var(--sans);
  font-size: max(15px, 0.8rem);
}

/* ---------- buttons ---------- */

.knopf {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  margin-top: 20px;
  padding: 0 20px;
  font-family: var(--sans);
  font-size: max(16px, 0.9rem);
  font-weight: 600;
  line-height: 1.2;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color var(--motion-snap), border-color var(--motion-snap), transform var(--motion-snap);
}

.knopf:active {
  transform: translateY(1px);
}

.knopf:focus-visible,
.verweis:focus-visible {
  outline: 2px solid var(--tinte);
  outline-offset: 3px;
}

/* The one brass spot of the view. */
.knopf.haupt {
  background: var(--messing);
  color: var(--tinte);
  border: 0;
}

/* Hover without a seventh tone: an ink ring. */
.knopf.haupt:hover {
  box-shadow: inset 0 0 0 2px var(--tinte);
}

.knopf.neben {
  background: transparent;
  color: var(--tinte);
  border: 2px solid var(--tinte);
}

.knopf.neben:hover {
  background: var(--flaeche);
}

.knopf[disabled],
.knopf[aria-busy="true"] {
  cursor: wait;
  opacity: 0.7;
}

.knopf[aria-busy="true"]::after {
  content: "";
  width: 16px;
  height: 16px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: drehen 700ms linear infinite;
}

.reihe {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.reihe .knopf {
  margin-top: 0;
}

.verweis {
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  color: var(--tinte);
  text-decoration: underline;
  text-decoration-color: var(--linie);
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
  transition: text-decoration-color var(--motion-snap);
}

.verweis:hover {
  text-decoration-color: var(--tinte);
}

.verweis[disabled] {
  color: var(--leise);
  text-decoration: none;
  cursor: default;
}

/* ---------- consent card ---------- */

.karte {
  margin: 0 0 24px;
  padding: 4px 20px;
  background: var(--weiss);
  border: 1px solid var(--linie);
  border-radius: 8px;
}

.karte div {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  padding: 14px 0;
  border-bottom: 1px solid var(--linie);
}

.karte div:last-child {
  border-bottom: 0;
}

.karte dt {
  font-family: var(--sans);
  font-size: max(15px, 0.8rem);
  color: var(--leise);
}

.karte dd {
  margin: 0;
  overflow-wrap: anywhere;
}

/* ---------- notices: ink with a 2 px border, no colour of their own ---------- */

.hinweis {
  margin: 20px 0 0;
  padding: 14px 16px;
  border: 2px solid var(--tinte);
  border-radius: 8px;
  font-size: 16px;
  line-height: 1.5;
}

.hinweis strong {
  font-family: var(--sans);
  font-weight: 600;
  display: block;
  margin-bottom: 4px;
}

.ruhig {
  min-height: 24px;
  margin: 16px 0 0;
  font-size: 15px;
  color: var(--leise);
}

/* ---------- motion ---------- */

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

@keyframes auftauchen {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .seitenfeld > * {
    animation: auftauchen var(--motion-slow) both;
  }
  .seitenfeld > *:nth-child(2) {
    animation-delay: 90ms;
  }
  .seitenfeld > *:nth-child(3) {
    animation-delay: 180ms;
  }
  .seitenfeld > *:nth-child(4) {
    animation-delay: 270ms;
  }
  .ansicht:not([hidden]) {
    animation: auftauchen var(--motion-smooth) both;
  }
}

[hidden] {
  display: none !important;
}

.unsichtbar {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- phone ---------- */

@media (max-width: 860px) {
  .blatt {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .seitenfeld {
    padding: 24px 16px 28px;
    gap: 20px;
    border-right: 0;
    border-bottom: 1px solid var(--linie);
  }
  .seitenfeld h1 {
    margin: 8px 0 0;
    font-size: clamp(1.75rem, 7vw, 2.1rem);
  }
  .seitenfeld .unterzeile,
  .seitenfeld .fuss {
    display: none;
  }
  .schritte {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  .schritte li {
    grid-template-columns: 1fr;
    padding: 8px 0 0;
    border-left: 0;
    border-top: 2px solid var(--linie);
  }
  .schritte li[aria-current="step"] {
    border-top-color: var(--tinte);
  }
  .arbeitsfeld {
    align-items: flex-start;
    padding: 32px 16px 48px;
  }
  .code {
    gap: 5px;
  }
  .code input {
    font-size: 21px;
    min-height: 44px;
  }
  .reihe {
    grid-template-columns: 1fr;
  }
}
