/* ==========================================================================
   Lucare AG — Design-System

   GESTALTUNGSRICHTUNG
   Moderne Tech-Oberflaeche, wie man sie von Apple, Google und Meta kennt:
   kuehle Neutraltoene, reinweisse Karten, weiche Schatten statt Rahmen,
   stark gerundete Formen, viel Luft, grosse ruhige Schrift — und genau EIN
   Akzent, ein klares Blau. Blau erscheint ausschliesslich dort, wo etwas
   klickbar oder aktiv ist. Das ist die Regel, die das Bild zusammenhaelt.

   Vertrautheit erzeugt Wohlgefuehl: das Hellgrau der Flaechen, die weichen
   Eingabefelder und die runden Pillen-Knoepfe sind genau die Muster, die
   Nutzer aus Instagram und Facebook kennen.

   Jedes klickbare Element hellt beim Ueberfahren auf — siehe Abschnitt
   "Aufhellen" am Ende. Heller werden und leicht anheben, nichts Buntes.

   ALLE FARBEN AENDERN heisst: nur den Block ":root" unten anfassen. Im
   restlichen Code steht kein einziger Farbwert.

   SCHRIFTEN: Aktuell Systemschriften — auf Apple-Geraeten also SF Pro, das
   Original. Vor dem Livegang optional selbst hosten (Inter Tight fuer Text,
   JetBrains Mono fuer Zahlen). Bewusst KEIN Google-Fonts-CDN, das
   uebertraegt bei jedem Aufruf die IP der Besucher.
   ========================================================================== */

:root {
  /* --- Helle Flaechen -------------------------------------------------- */
  --surface-0: #f5f6f8;   /* Seitenhintergrund, kuehles Hellgrau */
  --surface-1: #ffffff;   /* Karten */
  --surface-2: #eef0f4;   /* Eingabefelder, Umschalter */

  /* --- Dunkle Flaechen ------------------------------------------------- */
  --ink-900: #0e1116;     /* dunkle Abschnitte */
  --ink-800: #171b22;     /* Karten auf dunklem Grund */
  --ink-700: #21262f;

  /* --- Der eine Akzent ------------------------------------------------- */
  --accent:         #0a66ff;
  --accent-hover:   #2e7dff;
  --accent-soft:    #e8f0ff;   /* Flaechentint fuer aktive Zustaende */
  --accent-on-dark: #5c9cff;   /* heller, damit es auf Schwarz lesbar bleibt */

  /* --- Schrift und Linien ---------------------------------------------- */
  --text:               #0d1117;
  --text-muted:         #5f6b7a;
  --text-on-dark:       #f2f4f7;
  --text-on-dark-muted: #a3adba;
  --line:               rgba(13, 17, 23, 0.08);
  --line-on-dark:       rgba(242, 244, 247, 0.12);

  /* --- Aufhellen ------------------------------------------------------- */
  --hover-surface: #ffffff;
  --hover-field:   #f7f8fa;
  --hover-dark:    #262c35;

  /* --- Schatten, weich und neutral ------------------------------------- */
  --shadow-1: 0 1px 2px rgba(13, 17, 23, 0.06), 0 1px 3px rgba(13, 17, 23, 0.04);
  --shadow-2: 0 4px 14px -3px rgba(13, 17, 23, 0.09), 0 2px 6px -2px rgba(13, 17, 23, 0.06);
  --lift:     0 14px 30px -14px rgba(13, 17, 23, 0.24);
  --shadow-float: 0 28px 64px -22px rgba(13, 17, 23, 0.3),
                  0 8px 22px -14px rgba(13, 17, 23, 0.16);

  /* --- Typografie ------------------------------------------------------ */
  --font-display: "SF Pro Display", -apple-system, BlinkMacSystemFont,
                  "Segoe UI Variable Display", "Segoe UI", Inter, Roboto,
                  "Helvetica Neue", Arial, sans-serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas,
               "Liberation Mono", monospace;

  --step-0: clamp(1rem, 0.97rem + 0.15vw, 1.06rem);
  --step-1: clamp(1.15rem, 1.07rem + 0.35vw, 1.38rem);
  --step-2: clamp(1.45rem, 1.28rem + 0.8vw, 1.95rem);
  --step-3: clamp(1.85rem, 1.5rem + 1.6vw, 2.8rem);
  --step-4: clamp(2.5rem, 1.9rem + 3.2vw, 4.5rem);

  /* --- Raster ---------------------------------------------------------- */
  --container: 1240px;
  --container-narrow: 760px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section-y: clamp(4.5rem, 10vw, 9rem);
  --radius: 16px;        /* Bedienelemente */
  --radius-lg: 28px;     /* Karten */
  --radius-pill: 999px;  /* Knoepfe, Umschalter */

  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

/* --- Reset ----------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
  background: var(--surface-0);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--step-0);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, video { display: block; max-width: 100%; }

/* Muss nach den Layout-Klassen greifen: display:flex und display:grid
   wuerden das hidden-Attribut sonst aushebeln. */
[hidden] { display: none !important; }

button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }

:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.section--dark :focus-visible { outline-color: var(--accent-on-dark); }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0;
  margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.skip-link {
  position: absolute; left: 50%; top: 0; transform: translate(-50%, -120%);
  background: var(--ink-900); color: var(--text-on-dark);
  padding: 0.7rem 1.2rem; z-index: 200; text-decoration: none;
}
.skip-link:focus { transform: translate(-50%, 0); }

/* --- Typografie ------------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  line-height: 1.06;
  letter-spacing: -0.032em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); font-weight: 500; }
h2 { font-size: var(--step-3); font-weight: 500; }
h3 { font-size: var(--step-1); font-weight: 500; letter-spacing: -0.015em; }

p { text-wrap: pretty; }
.lead { font-size: var(--step-1); line-height: 1.55; font-weight: 300; color: var(--text-muted); }
.muted { color: var(--text-muted); }

/* Zahlen und Kennwerte — technisch, immer gleich breit */
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -0.02em; }

/* Kleines Label ueber einer Ueberschrift, mit Haarlinie davor */
.eyebrow {
  display: flex; align-items: center; gap: 0.75rem;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.35rem;
}
.eyebrow::before { content: ""; width: 1.75rem; height: 1px; background: currentColor; flex: none; }
.section--dark .eyebrow { color: var(--accent-on-dark); }

/* --- Layout ---------------------------------------------------------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section-y); }
.section--dark { background: var(--ink-900); color: var(--text-on-dark); }
.section--dark .lead, .section--dark .muted { color: var(--text-on-dark-muted); }

.grid { display: grid; gap: clamp(1.5rem, 3vw, 2.5rem); }
.grid--3 { grid-template-columns: repeat(auto-fit, minmax(min(270px, 100%), 1fr)); }

.rule { border: 0; border-top: 1px solid var(--line); }
.section--dark .rule { border-color: var(--line-on-dark); }

/* --- Buttons --------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55rem;
  padding: 1rem 1.9rem;
  font-size: 0.95rem; font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: background 0.22s var(--ease), color 0.22s var(--ease),
              border-color 0.22s var(--ease), box-shadow 0.22s var(--ease),
              transform 0.14s var(--ease);
}
.btn:active { transform: scale(0.985); }
.btn--primary { background: var(--accent); color: #ffffff; box-shadow: var(--shadow-1); }
.btn--quiet   { background: var(--surface-2); color: var(--text); }
.btn--ghost   { border-color: currentColor; background: transparent; }
.btn--block   { width: 100%; }

/* --- Formular -------------------------------------------------------- */
.field { display: flex; flex-direction: column; gap: 0.5rem; }
.field > label, .field > span {
  font-family: var(--font-mono);
  font-size: 0.66rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.section--dark .field > label, .section--dark .field > span { color: var(--text-on-dark-muted); }

/* Randlose, weich gefuellte Felder — das vertraute Muster aus Social-Apps */
input[type="text"], input[type="email"], input[type="tel"],
input[type="date"], input[type="time"], input[type="number"],
select, textarea {
  width: 100%;
  padding: 0.95rem 1.15rem;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  background: var(--surface-1);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(10, 102, 255, 0.15);
}
textarea { min-height: 7.5rem; resize: vertical; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%230d1117' stroke-width='1.5' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.15rem center;
  background-size: 12px;
  padding-right: 2.6rem;
  cursor: pointer;
}

/* Felder in dunklen Abschnitten: dunkel gefuellt statt hellgrau, sonst
   wirken sie wie Loecher im Panel. */
.section--dark :is(input[type="text"], input[type="email"], input[type="tel"],
input[type="date"], input[type="time"], input[type="number"], select, textarea) {
  background: rgba(242, 244, 247, 0.06);
  color: var(--text-on-dark);
}
.section--dark :is(input, textarea)::placeholder { color: var(--text-on-dark-muted); }
.section--dark :is(input, select, textarea):focus {
  background: rgba(242, 244, 247, 0.1);
  border-color: var(--accent-on-dark);
  box-shadow: 0 0 0 4px rgba(92, 156, 255, 0.2);
}
.section--dark select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%23f2f4f7' stroke-width='1.5' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
}
/* Datums- und Zeitwaehler des Browsers aufhellen, sonst bleibt das Symbol
   schwarz auf schwarz. */
.section--dark ::-webkit-calendar-picker-indicator { filter: invert(1) opacity(0.75); }

.checkbox { display: flex; align-items: flex-start; gap: 0.7rem; font-size: 0.92rem; cursor: pointer; transition: color 0.2s var(--ease); }
.checkbox input { width: 1.15rem; height: 1.15rem; margin-top: 0.28rem; accent-color: var(--accent); flex: none; cursor: pointer; }

/* Segment-Umschalter in Pillenform */
.segmented { display: flex; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--radius-pill); }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label {
  flex: 1; padding: 0.7rem 0.9rem;
  text-align: center; font-size: 0.88rem; font-weight: 500;
  border-radius: var(--radius-pill); cursor: pointer;
  transition: background 0.2s var(--ease), color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.segmented input:checked + label {
  background: var(--surface-1); color: var(--accent); box-shadow: var(--shadow-1);
}
.segmented input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }

/* --- Karten ---------------------------------------------------------- */
.card {
  background: var(--surface-1);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-2);
  padding: clamp(1.5rem, 3vw, 2.25rem);
}
.section--dark .card { background: var(--ink-800); box-shadow: none; border: 1px solid var(--line-on-dark); }

/* ==========================================================================
   AUFHELLEN BEIM UEBERFAHREN
   Alles Klickbare wird heller und hebt sich leicht. Nur auf Geraeten mit
   echtem Zeigegeraet, sonst bleibt der Zustand nach einer Beruehrung kleben.
   ========================================================================== */
@media (hover: hover) {
  .btn--primary:hover { background: var(--accent-hover); box-shadow: var(--lift); }
  .btn--quiet:hover   { background: var(--hover-surface); box-shadow: var(--shadow-2); }
  .btn--ghost:hover   { background: rgba(242, 244, 247, 0.1); }

  input:hover:not(:focus), select:hover:not(:focus), textarea:hover:not(:focus) {
    background: var(--hover-field);
  }
  .section--dark :is(input, select, textarea):hover:not(:focus) {
    background: rgba(242, 244, 247, 0.11);
  }

  .segmented label:hover { background: rgba(255, 255, 255, 0.65); }
  .segmented input:checked + label:hover { background: var(--surface-1); color: var(--accent-hover); }

  .checkbox:hover { color: var(--accent); }
  .section--dark .checkbox:hover { color: var(--accent-on-dark); }
}
