/* ── Sicherheit: [hidden] nie durch display:block überschreiben ─────────── */
.hw-wizard [hidden],
.hw-success [hidden] {
  display: none !important;
}

/**
 * EU-Richtlinien für WooCommerce – Frontend Styles (v1.4.0)
 * Schlank, full-width, Info-Tooltips, kein unterer Fortschrittsbalken.
 */

/* ── CSS Custom Properties ────────────────────────────────────────────────── */
.hw-wizard,
.hw-success,
.hw-footer-link {
  --hw-color-primary:      #1a1a1a;
  --hw-color-accent:       #c0392b;
  --hw-color-accent-hover: #a93226;
  --hw-color-bg:           #ffffff;
  --hw-color-bg-muted:     #f7f7f7;
  --hw-color-border:       #d8d8d8;
  --hw-color-text:         #1a1a1a;
  --hw-color-muted:        #6b6b6b;
  --hw-color-error:        #c0392b;
  --hw-color-success:      #27ae60;
  --hw-color-done:         #27ae60;
  --hw-radius:             4px;
  --hw-font:               inherit;
  --hw-transition:         0.18s ease;
}

/* ── Wizard-Wrapper – füllt immer den Container ───────────────────────────── */
.hw-wizard {
  width: 100%;
  box-sizing: border-box;
  font-family: var(--hw-font);
  color: var(--hw-color-text);
}

/* ── Fortschrittsanzeige ─────────────────────────────────────────────────── */
.hw-progress {
  margin-bottom: 28px;
}

.hw-progress__list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  position: relative;
}

/* Verbindungslinie */
.hw-progress__list::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 16px;
  right: 16px;
  height: 1px;
  background: var(--hw-color-border);
  z-index: 0;
}

.hw-progress__item {
  flex: 1;
  text-align: center;
  position: relative;
  z-index: 1;
}

.hw-progress__dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--hw-color-bg);
  border: 1px solid var(--hw-color-border);
  margin: 0 auto 6px;
  transition: background var(--hw-transition), border-color var(--hw-transition);
}

.hw-progress__num {
  font-size: 12px;
  font-weight: 600;
  color: var(--hw-color-muted);
  line-height: 1;
}

.hw-progress__label {
  font-size: 11px;
  color: var(--hw-color-muted);
  display: block;
  line-height: 1.3;
}

/* Aktiv */
.hw-progress__item--active .hw-progress__dot {
  background: var(--hw-color-primary);
  border-color: var(--hw-color-primary);
}
.hw-progress__item--active .hw-progress__num { color: #fff; }
.hw-progress__item--active .hw-progress__label {
  color: var(--hw-color-primary);
  font-weight: 600;
}

/* Abgeschlossen – Checkmark statt Zahl */
.hw-progress__item--done .hw-progress__dot {
  background: var(--hw-color-done);
  border-color: var(--hw-color-done);
}
.hw-progress__item--done .hw-progress__num { display: none; }
.hw-progress__item--done .hw-progress__dot::after {
  content: '';
  display: block;
  width: 9px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.hw-progress__item--done .hw-progress__label { color: var(--hw-color-done); }

/* ── Schritt-Header ───────────────────────────────────────────────────────── */
.hw-step__header {
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hw-color-border);
}

.hw-heading {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0;
  color: var(--hw-color-primary);
}

/* ── Step-Animationen ─────────────────────────────────────────────────────── */
.hw-step--entering { animation: hwIn 0.22s ease forwards; }
.hw-step--leaving  { animation: hwOut 0.18s ease forwards; pointer-events: none; }

@keyframes hwIn  { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
@keyframes hwOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateX(-14px); } }

/* ── Felder ───────────────────────────────────────────────────────────────── */
.hw-field { margin-bottom: 16px; width: 100%; box-sizing: border-box; }

.hw-field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
@media (max-width: 520px) { .hw-field-row { grid-template-columns: 1fr; } }

.hw-field label,
.hw-field__legend {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 5px;
  color: var(--hw-color-text);
}

.hw-field input[type="text"],
.hw-field input[type="email"],
.hw-field input[type="date"],
.hw-field textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 9px 11px;
  border: 1px solid var(--hw-color-border);
  border-radius: var(--hw-radius);
  font-size: 0.95rem;
  font-family: var(--hw-font);
  background: var(--hw-color-bg);
  color: var(--hw-color-text);
  transition: border-color var(--hw-transition), box-shadow var(--hw-transition);
  -webkit-appearance: none;
}

.hw-field input:focus,
.hw-field textarea:focus {
  outline: none;
  border-color: var(--hw-color-primary);
  box-shadow: 0 0 0 2px rgba(26,26,26,.08);
}

.hw-input--error { border-color: var(--hw-color-error) !important; }
.hw-input--error:focus { box-shadow: 0 0 0 2px rgba(192,57,43,.1) !important; }

/* ── Info-Icon & Tooltip ──────────────────────────────────────────────────── */
.hw-tooltip-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  line-height: 1;
}

.hw-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--hw-color-muted);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  font-style: normal;
  cursor: default;
  flex-shrink: 0;
  transition: background var(--hw-transition);
  user-select: none;
}

.hw-info-icon:hover,
.hw-tooltip-wrap:focus-within .hw-info-icon {
  background: var(--hw-color-primary);
}

.hw-tooltip {
  position: absolute;
  bottom: calc(100% + 7px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--hw-color-primary);
  color: #fff;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  padding: 8px 11px;
  border-radius: var(--hw-radius);
  white-space: normal;
  width: 220px;
  pointer-events: none;
  opacity: 0;
  transition: opacity var(--hw-transition);
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.15);
}

/* Pfeil */
.hw-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: var(--hw-color-primary);
}

.hw-tooltip-wrap:hover .hw-tooltip,
.hw-tooltip-wrap:focus-within .hw-tooltip {
  opacity: 1;
}

/* Tooltip nach rechts schieben wenn am linken Rand */
.hw-tooltip-wrap:first-child .hw-tooltip { left: 0; transform: none; }
.hw-tooltip-wrap:first-child .hw-tooltip::after { left: 12px; transform: none; }

/* ── Pflichtfeld-Markierung ───────────────────────────────────────────────── */
.hw-required { color: var(--hw-color-error); font-weight: 700; }
.hw-required-note { font-size: 0.8rem; color: var(--hw-color-muted); margin: 4px 0 0; }

/* ── Radio-Buttons ────────────────────────────────────────────────────────── */
.hw-radio-label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--hw-color-border);
  border-radius: var(--hw-radius);
  margin-bottom: 6px;
  cursor: pointer;
  transition: border-color var(--hw-transition), background var(--hw-transition);
  width: 100%;
  box-sizing: border-box;
}
.hw-radio-label:hover { border-color: var(--hw-color-primary); background: var(--hw-color-bg-muted); }
.hw-radio-label input[type="radio"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--hw-color-primary);
  cursor: pointer;
}
.hw-radio-label:has(input:checked) {
  border-color: var(--hw-color-primary);
  background: var(--hw-color-bg-muted);
}
.hw-radio-title { font-size: 0.9rem; font-weight: 500; }

/* ── Datenschutz-Box ──────────────────────────────────────────────────────── */
.hw-privacy-box {
  width: 100%;
  box-sizing: border-box;
  background: var(--hw-color-bg-muted);
  border: 1px solid var(--hw-color-border);
  border-radius: var(--hw-radius);
  padding: 16px;
  margin-bottom: 16px;
  font-size: 0.875rem;
  line-height: 1.65;
  max-height: 240px;
  overflow-y: auto;
}
.hw-privacy-box p { margin: 0 0 10px; }
.hw-privacy-box p:last-of-type { margin-bottom: 0; }
.hw-privacy-box__link {
  display: inline-block;
  margin-top: 10px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--hw-color-primary);
}

/* ── Checkbox ─────────────────────────────────────────────────────────────── */
.hw-checkbox-label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  cursor: pointer;
  padding: 12px;
  border: 1px solid var(--hw-color-border);
  border-radius: var(--hw-radius);
  width: 100%;
  box-sizing: border-box;
  transition: border-color var(--hw-transition);
}
.hw-checkbox-label:hover { border-color: var(--hw-color-primary); }
.hw-checkbox-label input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 1px;
  width: 17px;
  height: 17px;
  accent-color: var(--hw-color-primary);
}
.hw-checkbox-label--error { border-color: var(--hw-color-error); background: #fdf0ef; }
.hw-checkbox-text { font-size: 0.875rem; line-height: 1.5; }

/* ── Aktions-Leiste ───────────────────────────────────────────────────────── */
.hw-step__actions {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--hw-color-border);
  width: 100%;
  box-sizing: border-box;
}
.hw-step__actions--confirm { justify-content: space-between; }

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.hw-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 9px 20px;
  border: none;
  border-radius: var(--hw-radius);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--hw-transition), opacity var(--hw-transition);
  line-height: 1.4;
  text-decoration: none;
}
.hw-btn:active { opacity: 0.85; }
.hw-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.hw-btn--primary { background: var(--hw-color-primary); color: #fff; }
.hw-btn--primary:hover { opacity: 0.85; }

.hw-btn--confirm {
  background: var(--hw-color-accent);
  color: #fff;
  padding: 10px 24px;
  font-size: 0.95rem;
}
.hw-btn--confirm:hover { background: var(--hw-color-accent-hover); }

.hw-btn--ghost {
  background: transparent;
  color: var(--hw-color-muted);
  border: 1px solid var(--hw-color-border);
  font-weight: 500;
}
.hw-btn--ghost:hover { color: var(--hw-color-text); border-color: var(--hw-color-text); }

/* ── Zusammenfassung ──────────────────────────────────────────────────────── */
.hw-summary-table {
  width: 100%;
  border-collapse: collapse;
  border: 1px solid var(--hw-color-border);
  border-radius: var(--hw-radius);
  overflow: hidden;
  font-size: 0.875rem;
  margin-bottom: 4px;
}
.hw-summary-table tr { border-bottom: 1px solid var(--hw-color-border); }
.hw-summary-table tr:last-child { border-bottom: none; }
.hw-summary-table tr:nth-child(even) { background: var(--hw-color-bg-muted); }
.hw-summary-table th {
  text-align: left;
  padding: 9px 12px;
  width: 35%;
  color: var(--hw-color-muted);
  font-weight: 600;
  vertical-align: top;
}
.hw-summary-table td { padding: 9px 12px; vertical-align: top; word-break: break-word; }

/* ── Fehlermeldungen ──────────────────────────────────────────────────────── */
.hw-field-error,
.hw-error {
  margin-top: 5px;
  padding: 6px 10px;
  background: #fdf0ef;
  border-left: 3px solid var(--hw-color-error);
  color: var(--hw-color-error);
  font-size: 0.82rem;
  border-radius: 0 var(--hw-radius) var(--hw-radius) 0;
  line-height: 1.4;
}
.hw-error { margin-top: 10px; }

/* ── Danke-Seite ──────────────────────────────────────────────────────────── */
.hw-success {
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  padding: 40px 20px;
}
.hw-success__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: var(--hw-color-success);
  color: #fff;
}
.hw-success .hw-heading { margin-bottom: 6px; }
.hw-success__timestamp { font-size: 0.875rem; color: var(--hw-color-muted); margin: 0 0 12px; }
.hw-success__message { color: var(--hw-color-muted); line-height: 1.65; margin: 0 auto 12px; }
.hw-success__hint { font-size: 0.82rem; color: var(--hw-color-muted); font-style: italic; }

/* ── Honeypot ─────────────────────────────────────────────────────────────── */
.hw-hp { position: absolute; left: -9999px; visibility: hidden; }

/* ── Footer-Link ──────────────────────────────────────────────────────────── */
.hw-footer-link { text-align: center; padding: 12px 0; }
.hw-footer-link__anchor {
  display: inline-block;
  padding: 7px 16px;
  border: 2px solid var(--hw-color-accent);
  border-radius: var(--hw-radius);
  font-weight: 700;
  font-size: 0.875rem;
  text-decoration: none;
  color: var(--hw-color-accent);
  transition: background var(--hw-transition), color var(--hw-transition);
}
.hw-footer-link__anchor:hover { background: var(--hw-color-accent); color: #fff; }

/* Dynamisch per JS eingefügte Fehlerspans müssen sichtbar sein – aber NUR wenn
   das [hidden]-Attribut entfernt wurde. [hidden] = display:none darf nicht
   durch !important überschrieben werden (sonst rote Balken ohne Fehler). */
.hw-wizard .hw-field-error:not([hidden]) {
  display: block !important;
}
.hw-wizard .hw-error:not([hidden]) {
  display: block !important;
}
