/* ============================================================
   Kontaktformular — Stylesheet
   Alle Klassen mit kf- prefixed, damit keine Konflikte entstehen.
   Farben/Schriften via CSS-Variablen anpassbar.
   ============================================================ */

.kf-wrapper {
    /* ===== Theme-Variablen — hier anpassen ===== */
    --kf-color-primary: #e63946;           /* Hauptfarbe (Buttons, Akzente) */
    --kf-color-primary-dark: #c42d3a;
    --kf-color-primary-light: #fde8ea;
    --kf-color-text: #1a1a1a;
    --kf-color-text-muted: #6b7280;
    --kf-color-border: #d1d5db;
    --kf-color-border-focus: #e63946;
    --kf-color-bg: #ffffff;
    --kf-color-bg-subtle: #f9fafb;
    --kf-color-error: #dc2626;
    --kf-color-success: #16a34a;

    --kf-radius: 8px;
    --kf-radius-lg: 12px;
    --kf-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    --kf-shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.08);

    --kf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

    /* ===== Container ===== */
    max-width: 720px;
    margin: 0 auto;
    padding: 0;
    font-family: var(--kf-font);
    color: var(--kf-color-text);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

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

/* ============================================================
   Schritt-Indikator
   ============================================================ */
.kf-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 2rem;
    padding: 0 1rem;
}

.kf-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    opacity: 0.4;
    transition: opacity 0.3s ease;
}

.kf-step--active,
.kf-step--done {
    opacity: 1;
}

.kf-step__num {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--kf-color-bg-subtle);
    border: 2px solid var(--kf-color-border);
    color: var(--kf-color-text-muted);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.kf-step--active .kf-step__num {
    background: var(--kf-color-primary);
    border-color: var(--kf-color-primary);
    color: #fff;
}

.kf-step--done .kf-step__num {
    background: var(--kf-color-success);
    border-color: var(--kf-color-success);
    color: #fff;
}

.kf-step__label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--kf-color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.kf-step--active .kf-step__label {
    color: var(--kf-color-text);
}

.kf-step__connector {
    flex: 1;
    max-width: 60px;
    height: 2px;
    background: var(--kf-color-border);
    margin-top: -18px;
}

/* ============================================================
   Form / Panels
   ============================================================ */
.kf-form {
    background: var(--kf-color-bg);
    border: 1px solid var(--kf-color-border);
    border-radius: var(--kf-radius-lg);
    padding: 2rem;
    box-shadow: var(--kf-shadow);
}

.kf-panel {
    display: none;
    animation: kf-fade-in 0.35s ease;
}

.kf-panel--active {
    display: block;
}

@keyframes kf-fade-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.kf-panel__title {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--kf-color-text);
}

.kf-panel__lead {
    margin: 0 0 1.5rem;
    color: var(--kf-color-text-muted);
    font-size: 0.95rem;
}

/* ============================================================
   Honeypot (unsichtbar)
   ============================================================ */
.kf-hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* ============================================================
   Schritt 1: Anfragegründe
   ============================================================ */
.kf-reasons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.kf-reason {
    cursor: pointer;
    display: block;
}

.kf-reason input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.kf-reason__card {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    border: 2px solid var(--kf-color-border);
    border-radius: var(--kf-radius);
    background: var(--kf-color-bg);
    transition: all 0.2s ease;
    height: 100%;
}

.kf-reason:hover .kf-reason__card {
    border-color: var(--kf-color-primary);
    background: var(--kf-color-bg-subtle);
}

.kf-reason input[type="radio"]:checked + .kf-reason__card {
    border-color: var(--kf-color-primary);
    background: var(--kf-color-primary-light);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.kf-reason input[type="radio"]:focus-visible + .kf-reason__card {
    outline: 2px solid var(--kf-color-primary);
    outline-offset: 2px;
}

.kf-reason__icon {
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.kf-reason__text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.kf-reason__title {
    font-weight: 600;
    font-size: 0.95rem;
}

.kf-reason__hint {
    font-size: 0.8rem;
    color: var(--kf-color-text-muted);
}

/* ============================================================
   Schritt 2a: Info-Antwort
   ============================================================ */
.kf-info h2 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.kf-info h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
    color: black !important;
}

.kf-info p {
    margin: 0 0 1rem;
}

.kf-info ul {
    margin: 0 0 1rem;
    padding-left: 1.25rem;
}

.kf-info li {
    margin-bottom: 0.4rem;
}

.kf-info a {
    color: var(--kf-color-primary);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.kf-info-box {
    background: var(--kf-color-bg-subtle);
    border-left: 3px solid var(--kf-color-primary);
    padding: 1rem 1.25rem;
    border-radius: var(--kf-radius);
    margin: 1rem 0 1.5rem;
}

.kf-info-box__label {
    font-size: 0.8rem;
    color: var(--kf-color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    margin: 0 0 0.2rem !important;
}

.kf-info-box__value {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0 0 0.75rem !important;
}

.kf-info-box__value:last-child {
    margin-bottom: 0 !important;
}

.kf-info-link {
    display: inline-block;
    padding: 0.5rem 0;
    font-weight: 600;
}

.kf-info-hint {
    margin-top: 1.5rem;
    padding: 0.75rem 1rem;
    background: var(--kf-color-bg-subtle);
    border-radius: var(--kf-radius);
    font-size: 0.9rem;
    color: var(--kf-color-text-muted);
}

/* ============================================================
   Schritt 2b: Formularfelder
   ============================================================ */
.kf-field {
    margin-bottom: 1.25rem;
    position: relative;
}

.kf-field label {
    display: block;
    margin-bottom: 0.4rem;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--kf-color-text);
}

.kf-req {
    color: var(--kf-color-primary);
}

.kf-opt {
    color: var(--kf-color-text-muted);
    font-weight: 400;
    font-size: 0.85rem;
}

.kf-field input[type="text"],
.kf-field input[type="email"],
.kf-field input[type="tel"],
.kf-field input[type="date"],
.kf-field input[type="time"],
.kf-field input[type="number"],
.kf-field select,
.kf-field textarea {
    width: 100%;
    padding: 0.7rem 0.85rem;
    font-family: inherit;
    font-size: 1rem;
    color: var(--kf-color-text);
    background: var(--kf-color-bg);
    border: 1.5px solid var(--kf-color-border);
    border-radius: var(--kf-radius);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

/* Safari/iOS: type="date" und type="time" brauchen explizite Höhe,
   da sie sonst auf eine Browser-Default-Höhe schrumpfen */
.kf-field input[type="date"],
.kf-field input[type="time"] {
    min-height: 46px;
    line-height: 1.2;
    /* Firefox: Native Calendar/Clock-Picker beibehalten, aber Box stylen */
    -moz-appearance: none;
}

/* Select: Eigenes Dropdown-Icon, da appearance: none den nativen Pfeil entfernt */
.kf-field select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.85rem center;
    background-size: 1rem;
    padding-right: 2.5rem;
    cursor: pointer;
}

.kf-field input:focus,
.kf-field select:focus,
.kf-field textarea:focus {
    outline: none;
    border-color: var(--kf-color-border-focus);
    box-shadow: 0 0 0 3px rgba(230, 57, 70, 0.1);
}

.kf-field textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

.kf-field--error input,
.kf-field--error select,
.kf-field--error textarea {
    border-color: var(--kf-color-error);
}

.kf-field--error input:focus,
.kf-field--error select:focus,
.kf-field--error textarea:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.1);
}

.kf-error {
    display: none;
    margin-top: 0.3rem;
    font-size: 0.85rem;
    color: var(--kf-color-error);
}

.kf-field--error .kf-error {
    display: block;
}

.kf-counter {
    display: block;
    text-align: right;
    font-size: 0.8rem;
    color: var(--kf-color-text-muted);
    margin-top: 0.3rem;
}

/* Checkbox */
.kf-field--checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    font-size: 0.9rem;
    font-weight: 400;
    cursor: pointer;
    line-height: 1.5;
}

.kf-field--checkbox input[type="checkbox"] {
    flex-shrink: 0;
    margin-top: 0.15rem;
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--kf-color-primary);
}

.kf-field--checkbox a {
    color: var(--kf-color-primary);
    text-decoration: underline;
}

/* ============================================================
   Buttons & Actions
   ============================================================ */
.kf-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.kf-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    padding: 0.75rem 1.5rem;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;
    border: 1.5px solid transparent;
    border-radius: var(--kf-radius);
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    min-height: 44px; /* Touch-Target */
}

.kf-btn:focus-visible {
    outline: 2px solid var(--kf-color-primary);
    outline-offset: 2px;
}

.kf-btn--primary {
    background: var(--kf-color-primary);
    color: #fff;
}

.kf-btn--primary:hover:not(:disabled) {
    background: var(--kf-color-primary-dark);
}

.kf-btn--primary:disabled {
    background: var(--kf-color-border);
    color: var(--kf-color-text-muted);
    cursor: not-allowed;
}

.kf-btn--secondary {
    background: var(--kf-color-bg);
    color: var(--kf-color-text);
    border-color: var(--kf-color-border);
}

.kf-btn--secondary:hover:not(:disabled) {
    background: var(--kf-color-bg-subtle);
    border-color: var(--kf-color-text-muted);
}

.kf-btn--loading {
    position: relative;
    color: transparent !important;
    pointer-events: none;
}

.kf-btn--loading::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: kf-spin 0.7s linear infinite;
    color: #fff;
}

@keyframes kf-spin {
    to { transform: rotate(360deg); }
}

/* ============================================================
   Submit-Status / Fehlermeldung
   ============================================================ */
.kf-submit-status {
    margin-top: 1rem;
    padding: 0 1rem;
    font-size: 0.9rem;
    min-height: 1.2rem;
}

.kf-submit-status--error {
    color: var(--kf-color-error);
    padding: 0.75rem 1rem;
    background: #fef2f2;
    border-radius: var(--kf-radius);
    border-left: 3px solid var(--kf-color-error);
}

/* ============================================================
   Schritt 3: Erfolg
   ============================================================ */
.kf-success {
    text-align: center;
    padding: 2rem 1rem;
}

.kf-success__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: var(--kf-color-success);
    color: #fff;
    border-radius: 50%;
    margin-bottom: 1.5rem;
    animation: kf-pop-in 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes kf-pop-in {
    from { transform: scale(0); }
    to { transform: scale(1); }
}

.kf-success h2 {
    margin: 0 0 0.5rem;
    font-size: 1.5rem;
    color: var(--kf-color-text);
}

.kf-success p {
    margin: 0 0 0.75rem;
    color: var(--kf-color-text-muted);
}

.kf-success__hint {
    font-size: 0.85rem;
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 600px) {
    .kf-form {
        padding: 1.25rem;
        border-radius: var(--kf-radius);
    }

    .kf-step__label {
        font-size: 0.7rem;
    }

    .kf-step__connector {
        max-width: 30px;
    }

    .kf-panel__title {
        font-size: 1.25rem;
    }

    .kf-reasons {
        grid-template-columns: 1fr;
    }

    .kf-actions {
        flex-direction: column-reverse;
    }

    .kf-btn {
        width: 100%;
    }
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
    .kf-panel,
    .kf-success__icon,
    .kf-btn,
    .kf-reason__card {
        animation: none !important;
        transition: none !important;
    }
}

.kf-row .kf-field--grow {
    flex: 1 1 0;
    min-width: 0;
}