/* ==========================================================================
   FAMREV – Familienrevolution | Formular-Stylesheet
   Quelle: "FAMREV Brand - Familienrevolution/style-briefing.md"

   Schrift-Substitution (bewusst):
   Polarity und Brandon Grotesque sind kommerziell/custom und liegen nicht vor.
   Das Briefing nennt Josefin Sans und Nunito als Open-Source-Ersatz:
     Josefin Sans -> Display (ersetzt Polarity)
     Nunito       -> Body/UI  (ersetzt Brandon Grotesque)
   Beide sind lokal unter fonts/ eingebunden, nicht via Google-CDN (DSGVO).

   Klassen-Vokabular ist identisch mit bindu.css. Aenderungen hier immer
   dort spiegeln, sonst laufen die Formulare auseinander.
   ========================================================================== */

@import url('nunito.css');
@import url('josefinsans.css');

:root {
  /* Primaerfarben */
  --c-teal:        #168F8F;
  --c-raspberry:   #BC3B60;
  --c-navy:        #303246;

  /* Sekundaerfarben */
  --c-sage:        #7D9E7B;
  --c-beige:       #F5F3EF;
  --c-white:       #FCFCFC;
  --c-muted:       #737387;

  /* Funktionsfarben */
  --c-submit:      #2E8B6E;
  --c-submit-2:    #3A9E7F;
  --c-divider:     #5D7A3C;
  --c-required:    #CC0000;
  --c-border:      #CCCCCC;
  --c-error:       #CC0000;
  --c-error-bg:    #FDF0F0;
  --c-success:     #2E8B6E;
  --c-success-bg:  #EDF6F2;
  --c-badge-bg:    #EBEBED;

  --font-display:  'Josefin Sans', 'Trebuchet MS', sans-serif;
  --font-body:     'Nunito', 'Segoe UI', system-ui, sans-serif;

  --radius:        4px;
  --card-w:        700px;   /* Popup-Breite laut Briefing */
}

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

/* [hidden] muss jede Layout-Regel schlagen. Ohne !important gewinnen
   .field{display:grid} und .choice{display:flex} gegen das UA-Stylesheet,
   und per data-show-when ausgeblendete Felder blieben sichtbar. */
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 400;
  line-height: 30px;
  color: var(--c-navy);
  background: var(--c-beige);
  -webkit-font-smoothing: antialiased;
}

/* --------------------------------------------------------------------------
   Layout
   Funktioniert als Vollbild-Seite UND eingebettet im Popup (Briefing).
   Im Popup/iframe traegt der Host den Overlay-Hintergrund; dort .page--embed
   setzen, dann entfaellt der Aussenabstand.
   -------------------------------------------------------------------------- */
.page {
  max-width: var(--card-w);
  margin: 0 auto;
  padding: 40px 16px 64px;
}
.page--embed { padding: 0; }

.card {
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 10px 40px rgba(48, 50, 70, 0.10);
}
.page--embed .card { box-shadow: none; border-radius: 0; }

/* Header
   Das Briefing zeigt einen sage-gruenen Header mit weissem Logo. Die weisse
   Logo-Variante liegt nicht vor (nur dunkle Tinte auf Transparenz), darum
   heller Header + Sage als Akzentkante. Sobald das weisse Logo da ist:
   background auf var(--c-sage) und die Kante entfernen. */
.card__header {
  background: #ffffff;
  border-bottom: 4px solid var(--c-sage);
  padding: 28px 30px;
  text-align: center;
}
.card__logo {
  height: 52px;
  width: auto;
  max-width: 100%;
  display: inline-block;
}

/* Zwei Logos nebeneinander – fuer Seiten, die beide Marken bedienen
   (Steckbrief). Etwas kleiner als das Einzellogo, damit die Zeile nicht
   erschlaegt; auf schmalen Displays bricht sie um. */
.card__logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
}
.card__logos .card__logo { height: 42px; }

.card__body { padding: 40px; }

@media (max-width: 640px) {
  body { font-size: 17px; line-height: 26px; }
  .page { padding: 0; }
  .card { border-radius: 0; }
  .card__body { padding: 24px 18px; }
  .card__header { padding: 20px; }
  .card__logo { height: 40px; }
  .card__logos { gap: 18px; }
  .card__logos .card__logo { height: 32px; }
}

/* --------------------------------------------------------------------------
   Intro / Outro
   -------------------------------------------------------------------------- */
.intro { text-align: center; }
.intro__title {
  font-family: var(--font-body);
  font-size: 23px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--c-navy);
  margin: 0 0 12px;
}
.intro__text { margin: 0 auto; max-width: 52ch; }

.eyebrow {
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  line-height: 1.4;
  color: var(--c-teal);
  margin: 0 0 8px;
}

.outro { text-align: center; }
.outro p { margin: 0 0 8px; }
.outro a { color: var(--c-teal); }

/* --------------------------------------------------------------------------
   Sektionen
   -------------------------------------------------------------------------- */
.divider {
  border: none;
  border-top: 2px solid var(--c-divider);
  margin: 28px 0;
}

.section { margin: 0; }
.section__title {
  font-family: var(--font-body);
  font-size: 24px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--c-navy);
  margin: 0 0 4px;
}
.section__text {
  margin: 0 0 24px;
  font-size: 17px;
  line-height: 26px;
}
.section[hidden] { display: none; }

/* --------------------------------------------------------------------------
   Felder – Label links / Input rechts (30/70), mobil gestapelt
   -------------------------------------------------------------------------- */
.field {
  display: grid;
  grid-template-columns: 30% 1fr;
  gap: 8px 20px;
  align-items: start;
  margin-bottom: 20px;
}
.field__label {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--c-navy);
  padding-top: 10px;
}
.field__control { min-width: 0; }
.field__hint {
  grid-column: 2;
  font-size: 14px;
  line-height: 20px;
  color: var(--c-muted);
  margin: 4px 0 0;
}
.field--stack { grid-template-columns: 1fr; }
.field--stack .field__hint { grid-column: 1; }
.field--stack .field__label { padding-top: 0; }

.req { color: var(--c-required); font-size: 14px; }

@media (max-width: 640px) {
  .field { grid-template-columns: 1fr; gap: 6px; }
  .field__label { padding-top: 0; font-weight: 600; }
  .field__hint { grid-column: 1; }
}

/* --------------------------------------------------------------------------
   Controls
   -------------------------------------------------------------------------- */
.control {
  width: 100%;
  padding: 10px 14px;
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 24px;
  color: var(--c-navy);
  background: #ffffff;
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  transition: border-color .15s, box-shadow .15s;
}
.control:focus-visible {
  outline: none;
  border-color: var(--c-teal);
  box-shadow: 0 0 0 3px rgba(22, 143, 143, .15);
}
.control[aria-invalid="true"] {
  border-color: var(--c-error);
  box-shadow: 0 0 0 3px rgba(204, 0, 0, .10);
}
textarea.control { resize: vertical; min-height: 120px; }
select.control {
  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='%23303246' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px;
  padding-right: 38px;
}

/* Feldgruppe nebeneinander, z. B. Vorwahl / Telefonnummer, PLZ / Ort */
.row { display: flex; gap: 12px; }
.row > * { flex: 1; min-width: 0; }
.row > .row__narrow { flex: 0 0 30%; }
@media (max-width: 480px) { .row { flex-direction: column; } .row > .row__narrow { flex: 1; } }

/* Radio / Checkbox */
.choice-group { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 16px;
  line-height: 24px;
  cursor: pointer;
}
.choice input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--c-teal);
}
.choice--boxed {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 12px 14px;
  transition: border-color .15s, background-color .15s;
}
.choice--boxed:hover { border-color: var(--c-sage); background: #FAFBFA; }
.choice--boxed:has(input:checked) { border-color: var(--c-teal); background: rgba(22,143,143,.05); }

.consent {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 16px;
  line-height: 24px;
}
.consent input { flex: 0 0 auto; width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--c-teal); }
.consent a { color: var(--c-teal); }

/* Datei-Upload */
.dropzone {
  border: 2px dashed var(--c-border);
  border-radius: var(--radius);
  background: #FCFCFC;
  padding: 28px 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
.dropzone:hover,
.dropzone.is-dragover { border-color: var(--c-sage); background: #F7F9F7; }
.dropzone:focus-within { border-color: var(--c-teal); box-shadow: 0 0 0 3px rgba(22,143,143,.15); }
.dropzone input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone__cta { font-weight: 700; color: var(--c-teal); font-size: 16px; }
.dropzone__hint { font-size: 14px; line-height: 20px; color: var(--c-muted); margin-top: 6px; }
.filelist { list-style: none; margin: 12px 0 0; padding: 0; text-align: left; }
.filelist li {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 14px; line-height: 20px;
  background: var(--c-badge-bg);
  border-radius: var(--radius);
  padding: 8px 12px; margin-top: 6px;
}
.filelist button {
  border: none; background: none; cursor: pointer;
  color: var(--c-raspberry); font: inherit; font-weight: 700; padding: 0 4px;
}

/* --------------------------------------------------------------------------
   Fehler / Meldungen
   -------------------------------------------------------------------------- */
.error {
  display: none;
  font-size: 14px;
  line-height: 20px;
  color: var(--c-error);
  margin: 4px 0 0;
}
.error.is-visible { display: block; }
.field .error { grid-column: 2; }
.field--stack .error { grid-column: 1; }
@media (max-width: 640px) { .field .error { grid-column: 1; } }

.alert {
  display: none;
  border-radius: var(--radius);
  padding: 14px 16px;
  font-size: 16px;
  line-height: 24px;
  margin-bottom: 20px;
}
.alert.is-visible { display: block; }
.alert--error   { background: var(--c-error-bg);   color: var(--c-error);   border: 1px solid rgba(204,0,0,.25); }
.alert--success { background: var(--c-success-bg); color: var(--c-success); border: 1px solid rgba(46,139,110,.3); }

/* --------------------------------------------------------------------------
   Submit
   -------------------------------------------------------------------------- */
.actions { text-align: center; margin-top: 8px; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  color: #ffffff;
  background: linear-gradient(135deg, var(--c-submit), var(--c-submit-2));
  border: none;
  border-radius: var(--radius);
  padding: 14px 30px;
  min-width: 260px;
  cursor: pointer;
  transition: filter .15s, transform .05s;
}
.btn:hover:not(:disabled) { filter: brightness(1.06); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:focus-visible { outline: 3px solid var(--c-teal); outline-offset: 2px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

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

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* --------------------------------------------------------------------------
   Honeypot – muss fuer Menschen unsichtbar bleiben, fuer Bots ausfuellbar.
   Kein display:none: manche Bots ueberspringen versteckte Felder gezielt.
   -------------------------------------------------------------------------- */
.hp {
  position: absolute !important;
  left: -9999px !important;
  top: auto !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

/* Erfolgsansicht nach Absenden */
.done { text-align: center; padding: 20px 0; }
.done__title {
  font-family: var(--font-display);
  font-size: 34px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--c-teal);
  margin: 0 0 12px;
}
