/* Kontaktformular – Fürstenau Design System */

.kf-kontaktformular-wrapper {
    --kf-accent: var(--brand, #2581c4);
    --kf-accent-hover: var(--brand-hover, #1f6da6);
    --kf-text: var(--text-heading, #575656);
    --kf-muted: var(--text-muted, #6f6e6e);
    --kf-border: var(--border-default, #d5d4d4);
    --kf-radius: var(--radius-md, 4px);
    --kf-focus: var(--shadow-focus, 0 0 0 3px rgba(37, 129, 196, 0.35));
    --kf-font: var(--font-core, inherit);
    --kf-gap: var(--space-5, 20px);

    max-width: none;
    margin: 0;
    padding: 0;
    container-type: inline-size;
    container-name: kf-form;
}

.kf-formular {
    display: grid;
    gap: var(--kf-gap);
    background: transparent;
    padding: 0;
    border-radius: 0;
    font-family: var(--kf-font);
}

.kf-formular,
.kf-formular label,
.kf-formular .kf-formular-gruppe label,
.kf-formular input,
.kf-formular select,
.kf-formular textarea,
.kf-formular button {
    font-family: var(--kf-font) !important;
}

.kf-formular-gruppe {
    display: grid;
    gap: var(--space-2, 8px);
    align-content: start;
    margin-bottom: 0;
}

.kf-formular-gruppe label {
    display: block;
    margin-bottom: 0;
    font-weight: 600;
    color: var(--kf-text);
    font-size: var(--fs-small, 15px);
    line-height: 1.35;
}

.kf-required {
    color: var(--kf-accent);
}

.kf-formular-gruppe input[type="text"],
.kf-formular-gruppe input[type="email"],
.kf-formular-gruppe input[type="tel"],
.kf-formular-gruppe input[type="date"],
.kf-formular-gruppe select,
.kf-formular-gruppe textarea {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid var(--kf-border);
    border-radius: var(--kf-radius);
    font-size: var(--fs-body, 17px);
    line-height: 1.4;
    color: var(--kf-text);
    background: #fff;
    font-family: inherit;
    transition: border-color 200ms cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 120ms cubic-bezier(0.4, 0, 0.2, 1);
    box-sizing: border-box;
    min-height: 48px;
}

.kf-formular-gruppe input::placeholder,
.kf-formular-gruppe textarea::placeholder {
    color: var(--kf-muted);
    opacity: 1;
}

.kf-formular-gruppe select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236f6e6e' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    padding-right: 40px;
    cursor: pointer;
}

.kf-formular-gruppe select:invalid,
.kf-formular-gruppe select option[value=""] {
    color: var(--kf-muted);
}

.kf-formular-gruppe select option {
    color: var(--kf-text);
}

.kf-formular-gruppe input[type="date"] {
    min-height: 48px;
}

.kf-formular-gruppe input[type="date"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.55;
}

.kf-formular-gruppe input:focus,
.kf-formular-gruppe select:focus,
.kf-formular-gruppe textarea:focus {
    outline: none;
    border-color: var(--kf-accent);
    box-shadow: var(--kf-focus);
}

.kf-formular-gruppe textarea {
    resize: vertical;
    min-height: 140px;
    line-height: 1.62;
}

.kf-feld-hinweis {
    margin: 0;
    font-size: var(--fs-caption, 13px);
    line-height: 1.45;
    color: var(--kf-muted);
}

.kf-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.kf-checkbox input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    margin: 1px 0 0;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    cursor: pointer;
    border: 1px solid var(--kf-border);
    border-radius: 2px;
    background: #fff;
    display: grid;
    place-items: center;
    transition: background-color 200ms cubic-bezier(0.4, 0, 0.2, 1),
                border-color 200ms cubic-bezier(0.4, 0, 0.2, 1);
}

.kf-checkbox input[type="checkbox"]::after {
    content: "";
    width: 10px;
    height: 6px;
    border: 2px solid #fff;
    border-top: 0;
    border-right: 0;
    transform: rotate(-45deg) translate(1px, -1px);
    opacity: 0;
}

.kf-checkbox input[type="checkbox"]:checked {
    background: var(--kf-accent);
    border-color: var(--kf-accent);
}

.kf-checkbox input[type="checkbox"]:checked::after {
    opacity: 1;
}

.kf-checkbox input[type="checkbox"]:focus-visible {
    outline: none;
    box-shadow: var(--kf-focus);
}

.kf-checkbox label {
    margin-bottom: 0;
    font-weight: 400;
    cursor: pointer;
    font-size: var(--fs-small, 15px);
    line-height: 1.35;
    color: var(--kf-text);
}

.kf-checkbox label a {
    color: var(--kf-accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.kf-checkbox label a:hover {
    color: var(--kf-accent-hover);
}

.kf-submit-button {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: auto !important;
    max-width: 100%;
    background: var(--kf-accent) !important;
    background-color: var(--kf-accent) !important;
    color: #fff !important;
    padding: 16px 34px !important;
    border: none !important;
    border-radius: var(--kf-radius) !important;
    font-size: var(--fs-h4, 20px) !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    cursor: pointer;
    transition: background-color 200ms cubic-bezier(0.4, 0, 0.2, 1),
                transform 120ms cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: none !important;
    letter-spacing: 0 !important;
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
}

.kf-submit-button .kf-submit-icon,
.kf-submit-button svg,
.kf-submit-button .lucide {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
    stroke: currentColor;
}

.kf-submit-button:hover {
    background: var(--kf-accent-hover) !important;
    background-color: var(--kf-accent-hover) !important;
    box-shadow: none !important;
    filter: none !important;
    text-shadow: none !important;
    transform: none !important;
}

.kf-submit-button:focus-visible {
    outline: none !important;
    box-shadow: var(--kf-focus) !important;
}

.kf-submit-button:active {
    transform: scale(0.98);
    box-shadow: none !important;
}

.kf-submit-button:disabled {
    background: var(--gray-400, #b4b3b3) !important;
    cursor: not-allowed;
    transform: none;
}

.kf-nachricht {
    margin: 0;
    padding: 16px 20px;
    border-radius: var(--kf-radius);
    font-size: var(--fs-small, 15px);
    line-height: 1.55;
}

.kf-nachricht.success {
    background: var(--green-100, #e7f3ea);
    color: var(--kf-text);
    border: 1px solid var(--green-500, #3f9c5a);
}

.kf-nachricht.error {
    background: var(--red-100, #f8e8e6);
    color: var(--red-500, #c0392b);
    border: 1px solid var(--red-500, #c0392b);
}

.kf-hp-field {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    height: 0;
    width: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.kf-formular-titel {
    margin: 0;
    font-size: var(--fs-h3, 24px);
    font-weight: 700;
    color: var(--kf-text);
}

.kf-formular-zeile.kf-zwei-spalten {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--kf-gap);
}

.kf-formular-zeile.kf-zwei-spalten .kf-formular-gruppe {
    margin-bottom: 0;
}

.kf-datenschutz-hinweis {
    margin: 0;
    font-size: var(--fs-small, 15px);
    color: var(--kf-muted);
    line-height: 1.55;
}

.kf-turnstile-wrapper {
    margin: 0;
}

.kf-turnstile-error {
    margin-top: 8px;
    color: var(--red-500, #c0392b);
    font-size: 13px;
}

@container kf-form (max-width: 480px) {
    .kf-formular-zeile.kf-zwei-spalten {
        grid-template-columns: 1fr;
    }

    .kf-submit-button {
        width: 100% !important;
        padding: 14px 24px !important;
    }
}

@media (max-width: 480px) {
    .kf-submit-button {
        width: 100% !important;
        padding: 14px 24px !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .kf-formular-gruppe input,
    .kf-formular-gruppe select,
    .kf-formular-gruppe textarea,
    .kf-checkbox input[type="checkbox"],
    .kf-submit-button {
        transition: none;
    }
}
