/* ============================================================
   Formulare — gemeinsame Bausteine für Kontakt, Talent-Pool-Anfrage,
   Newsletter, Einwilligung. Felder ruhig und groß, Etiketten klar,
   Zusätze (optional, Hinweise, Rechtliches) in Mono wie auf dem Bon.
   ============================================================ */

/* ---------- Formularkarte ---------- */
.form-card {
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: clamp(1.35rem, 3.2vw, 2.75rem);
}

/* ---------- Zeilen + Etiketten ---------- */
.form { display: grid; gap: 1.35rem; }
.form-row { display: grid; gap: 0.5rem; min-width: 0; }
.form-row--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.35rem 1.1rem; }
.form-row--2 > div { display: grid; gap: 0.5rem; min-width: 0; align-content: start; }
@media (max-width: 620px) { .form-row--2 { grid-template-columns: 1fr; } }

.form-row label, .form-label {
  display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem;
  font-weight: 600; font-size: 0.95rem; line-height: 1.3;
}
.req { color: var(--brass-text); font-weight: 600; margin-left: 0.15em; }
.form-row label .req, .form-label .req { margin-right: auto; }
.opt {
  font-family: var(--font-label); font-weight: 400; font-size: 0.68rem;
  letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-soft);
}

/* ---------- Felder ---------- */
.form input[type="text"], .form input[type="email"], .form input[type="tel"],
.form input[type="search"], .form textarea {
  width: 100%; min-height: 54px;
  font: inherit; font-size: 1rem; line-height: 1.4; color: var(--ink);
  background: #fff;
  border: 1px solid rgb(14 21 18 / .26); border-radius: var(--radius-sm);
  padding: 0.85rem 1rem;
  appearance: none; -webkit-appearance: none;
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast), background-color var(--dur-fast);
}
.form textarea { min-height: 9.5rem; resize: vertical; display: block; }
.form ::placeholder { color: #6B766E; opacity: 1; }
@media (hover: hover) {
  .form input:not([type="checkbox"]):not([type="file"]):hover, .form textarea:hover { border-color: rgb(14 21 18 / .5); }
}
.form input:not([type="checkbox"]):not([type="file"]):focus, .form textarea:focus {
  outline: none; border-color: var(--ink);
  box-shadow: 0 0 0 3px rgb(201 164 106 / .55);
}
/* Erst nach einer Eingabe als fehlerhaft markieren */
.form input[placeholder]:not(:placeholder-shown):not(:focus):invalid { border-color: #A8402F; }

.form-hint { font-size: 0.86rem; line-height: 1.45; color: var(--ink-soft); }
.form-hint b { color: var(--ink); font-weight: 650; }

/* ---------- Honeypot: für Menschen unsichtbar ---------- */
.hp-field, .tpq__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Fehler ---------- */
.form-error {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.7rem; align-items: baseline;
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  background: #FBEDE9; color: #7A2617; border: 1px solid rgb(168 64 47 / .4);
  font-size: 0.94rem; line-height: 1.45;
}
.form-error::before { content: "!"; font-family: var(--font-label); font-weight: 500; }

/* ---------- Fuß: Kleingedrucktes + Absenden ---------- */
.form-foot {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 1.25rem 2rem; align-items: center;
  padding-top: 1.35rem; border-top: 1px dashed rgb(14 21 18 / .3);
}
.form-privacy { font-family: var(--font-label); font-size: 0.72rem; line-height: 1.6; letter-spacing: 0.01em; color: var(--ink-soft); }
.form-privacy a, .form-hint a, .form-legal a { color: var(--brass-text); text-decoration: underline; text-underline-offset: 0.2em; }
@media (max-width: 720px) {
  .form-foot { grid-template-columns: 1fr; }
  .form-foot .btn { width: 100%; }
}
/* Lange Beschriftungen dürfen umbrechen */
.btn--wrap { white-space: normal; text-align: center; line-height: 1.25; padding-block: 0.9em; }

/* ---------- Erfolgs-Panel ---------- */
.form-success { text-align: left; padding-block: clamp(1rem, 3vw, 2.5rem); }
.form-success__icon {
  width: 68px; height: 68px; border-radius: 50%;
  background: var(--green-900); color: var(--brass);
  display: grid; place-items: center; margin-bottom: 1.6rem;
}
.form-success__icon svg { width: 40px; height: 40px; }
.form-success__icon circle { display: none; }
.form-success__icon path { stroke-dasharray: 26; stroke-dashoffset: 26; animation: form-draw 500ms var(--ease-out) 250ms forwards; }
.form-success:not([hidden]) .form-success__icon { animation: form-pop 500ms var(--ease-spring) backwards; }
.form-success h2 { font-size: clamp(2.2rem, 1.6rem + 2.4vw, 3.4rem); }
.form-success p { margin-top: 1.1rem; color: var(--ink-soft); max-width: 48ch; font-size: var(--step-1); line-height: 1.5; }
@keyframes form-draw { to { stroke-dashoffset: 0; } }
@keyframes form-pop { from { transform: scale(0.6); opacity: 0; } }

/* ---------- Checkbox-Karte (Einwilligungen) ---------- */
.check-card {
  display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 1rem; align-items: start;
  padding: 1.15rem 1.2rem; cursor: pointer;
  background: #fff; border: 1px solid rgb(14 21 18 / .26); border-radius: var(--radius-sm);
  font-size: 0.93rem; line-height: 1.6; color: var(--ink-soft);
  transition: border-color var(--dur-fast), background-color var(--dur-fast), box-shadow var(--dur-fast);
}
.check-card input {
  appearance: none; -webkit-appearance: none; flex: none; margin: 0.1rem 0 0;
  width: 28px; height: 28px; border-radius: 6px; cursor: pointer;
  border: 1.5px solid rgb(14 21 18 / .5); background: #fff center / 18px no-repeat;
  transition: background-color var(--dur-fast), border-color var(--dur-fast);
}
.check-card input:checked {
  background-color: var(--green-900); border-color: var(--green-900);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%23C9A46A' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m3 8.5 3.5 3.5L13 5'/%3E%3C/svg%3E");
}
.check-card input:focus-visible { outline: 2px solid var(--brass-deep); outline-offset: 3px; }
.check-card__title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0.75rem; color: var(--ink); font-size: 1rem; line-height: 1.35; margin-bottom: 0.45rem; }
.check-card__title b { font-weight: 650; }
.check-card:has(input:checked) { border-color: var(--green-900); background: #F6F8F3; box-shadow: 0 0 0 1px var(--green-900); }
@media (hover: hover) { .check-card:hover { border-color: rgb(14 21 18 / .55); } }

/* ---------- Unterschriftenfeld ---------- */
.sig-pad { position: relative; background: #fff; border: 1px solid rgb(14 21 18 / .26); border-radius: var(--radius-sm); overflow: hidden; }
.sig-pad canvas { display: block; width: 100%; height: 160px; cursor: crosshair; position: relative; z-index: 1; }
.sig-pad canvas:focus-visible { outline: 2px solid var(--brass-deep); outline-offset: -3px; }
/* Grundlinie wie auf einem Formular */
.sig-pad::before { content: "×"; position: absolute; left: 1rem; bottom: 38px; font-family: var(--font-label); font-size: 1.1rem; line-height: 1; color: var(--ink-soft); }
.sig-pad::after { content: ""; position: absolute; left: 1rem; right: 1rem; bottom: 34px; border-top: 1px dashed rgb(14 21 18 / .4); }
.sig-pad__placeholder {
  position: absolute; inset: 0 1rem 44px; display: flex; align-items: center; justify-content: center; text-align: center;
  pointer-events: none; font-family: var(--font-label); font-size: 0.76rem; letter-spacing: 0.04em; color: var(--ink-soft);
}
.sig-pad__actions { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem 1.5rem; flex-wrap: wrap; }
.sig-pad__clear {
  min-height: 44px; padding: 0.5em 1.1em; border: 1px solid rgb(14 21 18 / .35); border-radius: 999px;
  font-size: 0.88rem; font-weight: 600; white-space: nowrap;
  transition: background-color var(--dur-fast), color var(--dur-fast), border-color var(--dur-fast);
}
@media (hover: hover) { .sig-pad__clear:hover { background: var(--ink); color: var(--porcelain); border-color: var(--ink); } }

/* ---------- Datei-Upload ---------- */
.upload { display: grid; gap: 0.85rem; padding: 1.15rem 1.2rem; background: #fff; border: 1px dashed rgb(14 21 18 / .45); border-radius: var(--radius-sm); }
.upload input[type="file"] { font: inherit; font-size: 0.92rem; color: var(--ink-soft); max-width: 100%; min-height: 48px; cursor: pointer; }
.upload input[type="file"]::file-selector-button {
  font: inherit; font-weight: 600; font-size: 0.92rem; color: var(--porcelain); background: var(--ink);
  border: 0; border-radius: 999px; min-height: 48px; padding: 0 1.35em; margin-right: 1rem; cursor: pointer;
  transition: background-color var(--dur-fast);
}
@media (hover: hover) { .upload input[type="file"]:hover::file-selector-button { background: var(--green-700); } }
.upload input[type="file"]:focus-visible { outline: 2px solid var(--brass-deep); outline-offset: 3px; border-radius: 999px; }

/* ---------- Rechtlicher Hinweis im Formular ---------- */
.form-legal { font-size: 0.86rem; line-height: 1.6; color: var(--ink-soft); padding: 1.1rem 1.2rem; background: var(--porcelain); border-radius: var(--radius-sm); }

@media (prefers-reduced-motion: reduce) {
  .form-success__icon path { stroke-dashoffset: 0; }
}

/* Schmal: Häkchen und Titel oben, der Einwilligungstext darunter in voller Breite */
@media (max-width: 560px) {
  .check-card { display: block; padding: 1rem; }
  .check-card::after { content: ""; display: block; clear: both; }
  .check-card input { float: left; margin: 0 0.85rem 0.5rem 0; }
  .check-card__title { display: block; min-height: 34px; }
  .check-card__title .opt { display: block; margin-top: 0.2rem; }
  .upload { padding: 1rem; min-width: 0; }
  .upload input[type="file"] { width: 100%; }
  .upload input[type="file"]::file-selector-button { margin-right: 0.7rem; padding: 0 1.1em; }
}
