/* =========================================================================
   Anfrageformular „Erstgespräch" – Formilo
   Eigenständige Formular-CSS (bewusst hier im /php-Ordner abgelegt).
   Nutzt die Marken-Tokens aus main.css (Farben, Fonts).
   ========================================================================= */

.eg-section {
   --eg-accent: var(--tj-color-theme-primary, #57b587);
   --eg-accent-dark: #418e69;
   --eg-dark: var(--tj-color-heading-primary, #051229);
   --eg-text: var(--tj-color-text-body, #364052);
   --eg-muted: #7e8590;
   --eg-line: #e2e8f0;
   --eg-line-strong: #cfd8e3;
   --eg-bg-soft: #f5f8fb;
   --eg-radius: 16px;
   background: linear-gradient(180deg, #ffffff 0%, #eef3f8 100%);
   /* Offset für den absolut positionierten Header (JS setzt den exakten Wert:
      Header-Höhe + 68px Abstand). Fallback verhindert Überlappung vor dem JS. */
   padding-top: var(--eg-header-offset, 168px);
}
@media (max-width: 991px) {
   .eg-section { padding-top: var(--eg-header-offset, 128px); }
}

/* ---------- Intro ---------- */
.eg-intro { text-align: center; margin-bottom: 68px; }
.eg-eyebrow {
   display: inline-block;
   font-family: var(--tj-ff-body, 'Lato', sans-serif);
   font-weight: 700;
   letter-spacing: .12em;
   text-transform: uppercase;
   font-size: 13px;
   color: var(--eg-accent-dark);
   background: rgba(87,181,135,.12);
   padding: 7px 16px;
   border-radius: 999px;
   margin-bottom: 18px;
}
.eg-title {
   font-family: var(--tj-ff-heading, 'Libre Franklin', serif);
   color: var(--eg-dark);
   font-size: clamp(28px, 4vw, 44px);
   line-height: 1.12;
   margin: 0 0 16px;
}
.eg-lead {
   color: var(--eg-text);
   font-size: 18px;
   line-height: 1.6;
   max-width: 640px;
   margin: 0 auto 22px;
}
.eg-trust {
   list-style: none; margin: 0; padding: 0;
   display: flex; flex-wrap: wrap; gap: 10px 22px;
   justify-content: center;
}
.eg-trust li {
   display: inline-flex; align-items: center; gap: 8px;
   font-size: 15px; font-weight: 600; color: var(--eg-dark);
}
.eg-trust li i { color: var(--eg-accent); font-size: 14px; }

/* ---------- Card ---------- */
.eg-card {
   background: #fff;
   border: 1px solid var(--eg-line);
   border-radius: 22px;
   box-shadow: 0 24px 60px -30px rgba(5,18,41,.28);
   padding: clamp(22px, 3.5vw, 44px);
}

/* ---------- Fortschritt ---------- */
.eg-progress { margin-bottom: 30px; }
.eg-progress-head {
   display: flex; justify-content: space-between; align-items: baseline;
   margin-bottom: 10px;
}
.eg-step-label { font-weight: 700; color: var(--eg-dark); font-size: 15px; }
.eg-step-pct { font-weight: 700; color: var(--eg-accent-dark); font-size: 15px; }
.eg-progress-bar {
   height: 10px; border-radius: 999px;
   background: #e8eef4; overflow: hidden;
}
.eg-progress-bar span {
   display: block; height: 100%; width: 20%;
   border-radius: 999px;
   background: linear-gradient(90deg, var(--eg-accent), var(--eg-accent-dark));
   transition: width .5s cubic-bezier(.4,0,.2,1);
}

/* ---------- Schritte ---------- */
.eg-step { display: none; animation: egFade .35s ease; }
.eg-step.is-active { display: block; }
@keyframes egFade {
   from { opacity: 0; transform: translateY(8px); }
   to   { opacity: 1; transform: translateY(0); }
}
.eg-q {
   font-family: var(--tj-ff-heading, 'Libre Franklin', serif);
   color: var(--eg-dark);
   font-size: clamp(21px, 2.6vw, 28px);
   line-height: 1.25;
   margin: 0 0 8px;
}
.eg-hint { color: var(--eg-muted); font-size: 15px; margin: 0 0 20px; }
.eg-sub-q { color: var(--eg-dark); font-weight: 600; font-size: 16px; margin: 46px 0 14px; }
.eg-multi {
   display: inline-block;
   font-size: 12.5px; font-weight: 700;
   color: var(--eg-accent-dark);
   background: rgba(87,181,135,.12);
   padding: 3px 10px; border-radius: 999px;
   letter-spacing: .02em;
   vertical-align: middle;
}

/* ---------- Options-Grid (kachelartig) ---------- */
.eg-options { display: grid; gap: 14px; margin-top: 34px; }
.eg-cols-1 { grid-template-columns: 1fr; }
.eg-cols-2 { grid-template-columns: 1fr 1fr; }
/* Kompaktliste gehört eng zu ihrer Zwischenüberschrift -> kleiner Abstand nach oben */
.eg-options-compact { gap: 10px; margin-top: 14px; }
/* „Weitere Formulare"-Label ist eine neue Gruppe -> deutlich Abstand nach oben */
#egBeispielReveal .eg-field-label { margin-top: 46px; }
@media (max-width: 640px) {
   .eg-cols-2 { grid-template-columns: 1fr; }
}

/* ---------- Kachel ---------- */
.eg-tile {
   position: relative;
   display: flex; align-items: flex-start; gap: 14px;
   padding: 18px 18px 18px 52px;
   border: 1.5px solid var(--eg-line-strong);
   border-radius: 14px;
   background: #fff;
   cursor: pointer;
   transition: border-color .18s, background .18s, box-shadow .18s, transform .05s;
   user-select: none;
}
.eg-tile:hover { border-color: var(--eg-accent); background: var(--eg-bg-soft); }
.eg-tile:active { transform: scale(.994); }
.eg-tile input { position: absolute; opacity: 0; pointer-events: none; }

/* Indikator links oben: Kreis (radio) / abgerundetes Quadrat (checkbox) */
.eg-mark {
   position: absolute;
   top: 17px; left: 18px;
   width: 22px; height: 22px;
   border: 2px solid var(--eg-line-strong);
   background: #fff;
   transition: border-color .18s, background .18s;
}
.eg-tile[data-type="radio"] .eg-mark { border-radius: 50%; }
.eg-tile[data-type="checkbox"] .eg-mark { border-radius: 7px; }
.eg-mark::after {
   content: "";
   position: absolute;
   opacity: 0;
   transition: opacity .15s, transform .15s;
}
/* Radio: gefüllter Punkt */
.eg-tile[data-type="radio"] .eg-mark::after {
   inset: 4px; border-radius: 50%; background: #fff; transform: scale(.4);
}
/* Checkbox: Häkchen */
.eg-tile[data-type="checkbox"] .eg-mark::after {
   left: 6px; top: 2px; width: 6px; height: 11px;
   border: solid #fff; border-width: 0 2.5px 2.5px 0;
   transform: rotate(45deg) scale(.6);
}

/* Ausgewählt */
.eg-tile.is-selected {
   border-color: var(--eg-accent);
   background: rgba(87,181,135,.08);
   box-shadow: 0 0 0 3px rgba(87,181,135,.14);
}
.eg-tile.is-selected .eg-mark {
   border-color: var(--eg-accent);
   background: var(--eg-accent);
}
.eg-tile.is-selected .eg-mark::after { opacity: 1; transform: none; }
.eg-tile[data-type="radio"].is-selected .eg-mark::after { transform: none; }
.eg-tile[data-type="checkbox"].is-selected .eg-mark::after { transform: rotate(45deg); }

.eg-tile-text { display: flex; flex-direction: column; gap: 3px; }
.eg-tile-title { font-weight: 600; color: var(--eg-dark); font-size: 16px; line-height: 1.35; }
.eg-tile-sub { color: var(--eg-muted); font-size: 14px; }
.eg-tile-wide { width: 100%; }

/* Kompakte kleine Kacheln (Formularauswahl) */
.eg-tile-sm { padding: 12px 12px 12px 44px; border-radius: 12px; }
.eg-tile-sm .eg-mark { top: 12px; left: 13px; width: 19px; height: 19px; }
.eg-tile-sm .eg-tile-title { font-size: 14.5px; font-weight: 500; }
.eg-tile-sm[data-type="checkbox"] .eg-mark::after { left: 5px; top: 2px; width: 5px; height: 9px; }

/* ---------- Reveal ---------- */
.eg-reveal { margin-top: 18px; }
.eg-reveal[hidden] { display: none; }

/* ---------- Upload ---------- */
.eg-drop {
   position: relative;
   margin-top: 34px;
   border: 2px dashed var(--eg-line-strong);
   border-radius: 16px;
   background: var(--eg-bg-soft);
   padding: 38px 20px;
   text-align: center;
   cursor: pointer;
   transition: border-color .18s, background .18s;
}
.eg-drop:hover, .eg-drop.is-drag { border-color: var(--eg-accent); background: rgba(87,181,135,.06); }
.eg-drop input[type="file"] {
   position: absolute; inset: 0; width: 100%; height: 100%;
   opacity: 0; cursor: pointer;
}
.eg-drop-inner i { font-size: 34px; color: var(--eg-accent); }
.eg-drop-title { margin: 12px 0 4px; font-weight: 600; color: var(--eg-dark); font-size: 17px; }
.eg-drop-title span { color: var(--eg-accent-dark); text-decoration: underline; }
.eg-drop-sub { color: var(--eg-muted); font-size: 14px; margin: 0; }

.eg-filelist { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 10px; }
.eg-filelist li {
   display: flex; align-items: center; gap: 12px;
   padding: 11px 14px; border: 1px solid var(--eg-line);
   border-radius: 12px; background: #fff; font-size: 15px; color: var(--eg-dark);
}
.eg-filelist li .eg-file-ic { color: var(--eg-accent); }
.eg-filelist li .eg-file-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.eg-filelist li.is-uploading { opacity: .6; }
.eg-file-remove {
   border: none; background: none; cursor: pointer; color: var(--eg-muted);
   font-size: 16px; padding: 4px; line-height: 1;
}
.eg-file-remove:hover { color: var(--tj-color-red-1, #ff0000); }
.eg-note { margin: 16px 0 0; font-size: 14px; color: var(--eg-muted); }
.eg-note i { color: var(--eg-accent); margin-right: 6px; }

/* ---------- Kontaktfelder ---------- */
.eg-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; margin-top: 34px; }
.eg-field { display: flex; flex-direction: column; }
.eg-field-full { grid-column: 1 / -1; }
@media (max-width: 640px) { .eg-fields { grid-template-columns: 1fr; } }
.eg-field-label { font-weight: 600; color: var(--eg-dark); font-size: 14.5px; margin-bottom: 7px; display: block; }
.eg-req { color: var(--eg-accent-dark); }
.eg-opt { color: var(--eg-muted); font-weight: 400; }
.eg-input, .eg-textarea {
   width: 100%;
   border: 1.5px solid var(--eg-line-strong);
   border-radius: 12px;
   padding: 13px 15px;
   font-family: var(--tj-ff-body, 'Lato', sans-serif);
   font-size: 14.5px; color: var(--eg-dark);
   background: #fff;
   transition: border-color .18s, box-shadow .18s;
}
.eg-input:focus, .eg-textarea:focus {
   outline: none; border-color: var(--eg-accent);
   box-shadow: 0 0 0 3px rgba(87,181,135,.15);
}
.eg-input.is-invalid, .eg-textarea.is-invalid { border-color: var(--tj-color-red-1, #ff0000); }
.eg-input::-webkit-input-placeholder, .eg-textarea::-webkit-input-placeholder { font-size: 14.5px; color: #9aa3ad; opacity: 1; }
.eg-input::-moz-placeholder, .eg-textarea::-moz-placeholder { font-size: 14.5px; color: #9aa3ad; opacity: 1; }
.eg-input:-ms-input-placeholder, .eg-textarea:-ms-input-placeholder { font-size: 14.5px; color: #9aa3ad; }
.eg-input::placeholder, .eg-textarea::placeholder { font-size: 14.5px; color: #9aa3ad; opacity: 1; }
.eg-textarea { resize: vertical; min-height: 96px; }
.eg-select {
   -webkit-appearance: none !important;
      -moz-appearance: none !important;
           appearance: none !important;
   padding-right: 44px; cursor: pointer;
   background-color: #fff;
   background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='9' viewBox='0 0 14 9'%3E%3Cpath d='M1 1l6 6 6-6' fill='none' stroke='%237e8590' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
   background-repeat: no-repeat;
   background-position: right 16px center;
}
.eg-select::-ms-expand { display: none; }
.eg-field-hint { color: var(--eg-muted); font-size: 13px; margin-top: 6px; }

.eg-final-trust {
   display: flex; flex-wrap: wrap; gap: 10px 22px;
   margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--eg-line);
}
.eg-final-trust span { display: inline-flex; align-items: center; gap: 8px; font-size: 14.5px; font-weight: 600; color: var(--eg-dark); }
.eg-final-trust i { color: var(--eg-accent); font-size: 13px; }

/* ---------- Honeypot ---------- */
.eg-hp { position: absolute; left: -9999px; top: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Fehler ---------- */
.eg-error {
   margin: 20px 0 0; padding: 13px 16px;
   background: rgba(255,0,0,.06); border: 1px solid rgba(255,0,0,.25);
   border-radius: 12px; color: #b12020; font-size: 15px; font-weight: 600;
}

/* ---------- Navigation ---------- */
.eg-nav {
   display: flex; align-items: center; justify-content: space-between;
   gap: 14px; margin-top: 28px;
}
.eg-nav-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.eg-btn-back, .eg-btn-skip {
   border: none; background: none; cursor: pointer;
   font-family: var(--tj-ff-body, 'Lato', sans-serif);
   font-weight: 600; font-size: 15px; color: var(--eg-muted);
   display: inline-flex; align-items: center; gap: 8px;
   padding: 12px 6px;
}
.eg-btn-back:hover, .eg-btn-skip:hover { color: var(--eg-dark); }
.eg-btn-next, .eg-btn-submit {
   border: none; cursor: pointer;
   font-family: var(--tj-ff-body, 'Lato', sans-serif);
   font-weight: 700; font-size: 16px; color: #fff;
   background: var(--eg-accent);
   padding: 15px 28px; border-radius: 12px;
   display: inline-flex; align-items: center; gap: 10px;
   transition: background .18s, transform .05s, box-shadow .18s;
   box-shadow: 0 10px 22px -10px rgba(87,181,135,.7);
}
.eg-btn-next:hover, .eg-btn-submit:hover { background: var(--eg-accent-dark); }
.eg-btn-next:active, .eg-btn-submit:active { transform: translateY(1px); }
.eg-btn-submit[disabled] { opacity: .7; cursor: default; }

.eg-spinner {
   width: 17px; height: 17px; border-radius: 50%;
   border: 2.5px solid rgba(255,255,255,.5); border-top-color: #fff;
   animation: egSpin .7s linear infinite; display: inline-block;
}
@keyframes egSpin { to { transform: rotate(360deg); } }

.eg-reassure { text-align: right; color: var(--eg-muted); font-size: 13.5px; margin: 12px 0 0; }
.eg-privacy-note { margin: 26px 0 0; font-size: 13.5px; color: var(--eg-muted); line-height: 1.55; }
.eg-privacy-note a { color: var(--eg-accent-dark); text-decoration: underline; font-weight: 600; }
@media (max-width: 640px) {
   .eg-nav { flex-wrap: wrap; }
   .eg-btn-next, .eg-btn-submit { width: 100%; justify-content: center; }
   .eg-nav-right { width: 100%; flex-direction: column-reverse; align-items: stretch; }
   .eg-reassure { text-align: center; }
}

/* ---------- Danke-Screen ---------- */
.eg-done { text-align: center; padding: 24px 10px 12px; animation: egFade .4s ease; }
.eg-done[hidden] { display: none; }
.eg-done-check {
   width: 84px; height: 84px; margin: 0 auto 24px;
   border-radius: 50%;
   background: rgba(87,181,135,.14);
   display: flex; align-items: center; justify-content: center;
}
.eg-done-check i { font-size: 38px; color: var(--eg-accent); animation: egPop .45s .1s both cubic-bezier(.2,1.4,.4,1); }
@keyframes egPop { from { transform: scale(0); } to { transform: scale(1); } }
.eg-done-title {
   font-family: var(--tj-ff-heading, 'Libre Franklin', serif);
   color: var(--eg-dark); font-size: clamp(24px, 3vw, 32px); margin: 0 0 14px;
}
.eg-done-text { color: var(--eg-text); font-size: 17px; line-height: 1.6; max-width: 560px; margin: 0 auto 26px; }
.eg-done-home {
   display: inline-block; font-weight: 700; color: var(--eg-accent-dark);
   border: 1.5px solid var(--eg-accent); border-radius: 12px;
   padding: 12px 26px; text-decoration: none; transition: background .18s, color .18s;
}
.eg-done-home:hover { background: var(--eg-accent); color: #fff; }
