/*
 * Typoindex Kontaktformular – Stylesheet v1.4.0
 * Schriftart, -größe und Button-Stil erben vom Enfold Theme.
 * Themes: .tk-theme-light (Standard) / .tk-theme-dark
 */

/* ── Wrapper ─────────────────────────────────────────────────── */

.tk-form,
.tk-success,
.tk-errors {
    max-width: 100%;
    font-family: inherit;
    font-size: inherit;
}

/* ── Erfolgsmeldung ──────────────────────────────────────────── */

.tk-success {
    background: #f0f7f0;
    border-left: 4px solid #4a9e4a;
    padding: 20px 24px;
    border-radius: 2px;
}

/* ── Fehlerliste ─────────────────────────────────────────────── */

.tk-errors {
    background: #fdf3f3;
    border-left: 4px solid #c0392b;
    padding: 16px 24px;
    margin-bottom: 24px;
    border-radius: 2px;
}

.tk-errors ul {
    margin: 8px 0 0;
    padding-left: 18px;
}

.tk-errors li {
    margin-bottom: 4px;
    font-size: 0.9em;
}

/* ── Fieldsets ───────────────────────────────────────────────── */

.tk-form fieldset {
    border: none;
    padding: 0;
    margin: 0 0 28px;
}

.tk-form legend {
    font-weight: 500 !important;
    font-size: inherit;
    font-family: inherit;
    margin-bottom: 14px;
    padding-bottom: 6px;
    border-bottom: 1px solid #ddd;
    width: 100%;
    display: block;
}

/* ── Zeilen ──────────────────────────────────────────────────── */

.tk-row {
    margin-bottom: 14px;
}

.tk-row label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9em;
    font-family: inherit;
    font-weight: 400 !important;
}

/* Zwei-Spalten-Layout */
.tk-row-split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 540px) {
    .tk-row-split {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* ── Felder ──────────────────────────────────────────────────── */
/* Kein eigenes Box-Styling (border/background/radius) – Enfolds
   native Formularfeld-Optik greift automatisch durch die Kaskade. */

.tk-form input[type="text"],
.tk-form input[type="tel"],
.tk-form input[type="email"],
.tk-form input[type="date"],
.tk-form textarea {
    width: 100%;
    font-size: inherit;
    font-family: inherit;
    color: inherit;
    box-sizing: border-box;
}

/* Fehlerfeld – bewusst mit !important, damit die Validierung
   sichtbar bleibt, egal wie Enfold Inputs sonst stylt */
.tk-form input.tk-error,
.tk-form textarea.tk-error {
    border-color: #c0392b !important;
    background: #fdf3f3 !important;
}

/* Datumsfeld etwas schmaler */
.tk-row-date input[type="date"] {
    max-width: 220px;
}

.tk-hint {
    display: block;
    font-size: 0.8em;
    color: #888;
    margin-top: 5px;
}

/* ── Honeypot ausblenden ─────────────────────────────────────── */

.tk-hp {
    position: absolute;
    left: -9999px;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

/* ── Pflichtfeld-Marker ──────────────────────────────────────── */

.tk-req {
    color: #c0392b;
}

/* ── Submit-Zeile ────────────────────────────────────────────── */

.tk-submit {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 8px;
}

.tk-form button[type="submit"] {
    padding: 12px 28px;
    font-size: inherit;
    font-family: inherit;
    border-radius: 100px;
    cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
}

.tk-form button[type="submit"]:hover {
    opacity: 0.8;
}

/* Light: dunkler Button als Fallback falls Theme keinen setzt */
.tk-form.tk-theme-light button[type="submit"] {
    background: #1a1a1a;
    color: #fff;
    border: none;
}

/* Dark: heller Button */
.tk-form.tk-theme-dark button[type="submit"] {
    background: #ffffff !important;
    color: #1a1a1a !important;
    border: none !important;
}

.tk-pflicht {
    font-size: 0.8em;
    color: #888;
}

@media (max-width: 400px) {
    .tk-submit {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ── Datenschutz-Checkbox ────────────────────────────────────── */

.tk-datenschutz {
    margin-bottom: 20px;
}

.tk-checkbox-label {
    display: flex !important;
    align-items: flex-start;
    gap: 10px;
    font-size: 0.85em;
    font-weight: 400 !important;
    line-height: 1.5;
    cursor: pointer;
}

.tk-checkbox-label input[type="checkbox"] {
    flex-shrink: 0;
    width: 17px;
    height: 17px;
    margin-top: 2px;
    cursor: pointer;
}

.tk-checkbox-label input[type="checkbox"].tk-error {
    outline: 2px solid #c0392b;
    outline-offset: 2px;
}

.tk-checkbox-label a {
    color: inherit;
    text-decoration: underline;
}

.tk-form.tk-theme-dark .tk-checkbox-label input[type="checkbox"].tk-error {
    outline-color: #e74c3c;
}

.tk-form.tk-theme-dark label,
.tk-form.tk-theme-dark legend,
.tk-form.tk-theme-dark .tk-hint,
.tk-form.tk-theme-dark .tk-pflicht,
.tk-success.tk-theme-dark,
.tk-errors.tk-theme-dark {
    color: #ffffff !important;
}

.tk-form.tk-theme-dark legend {
    border-bottom-color: rgba(255,255,255,0.2) !important;
}

.tk-form.tk-theme-dark input[type="text"],
.tk-form.tk-theme-dark input[type="tel"],
.tk-form.tk-theme-dark input[type="email"],
.tk-form.tk-theme-dark input[type="date"],
.tk-form.tk-theme-dark textarea {
    background: rgba(255,255,255,0.08) !important;
    border-color: rgba(255,255,255,0.25) !important;
    color: #ffffff !important;
    color-scheme: dark;
}

.tk-form.tk-theme-dark input.tk-error,
.tk-form.tk-theme-dark textarea.tk-error {
    border-color: #e74c3c !important;
    background: rgba(231,76,60,0.15) !important;
}

.tk-form.tk-theme-dark .tk-hint {
    color: rgba(255,255,255,0.5) !important;
}

.tk-form.tk-theme-dark .tk-pflicht {
    color: rgba(255,255,255,0.5) !important;
}

.tk-success.tk-theme-dark {
    background: rgba(74,158,74,0.2);
    border-left-color: #4a9e4a;
}

.tk-errors.tk-theme-dark {
    background: rgba(192,57,43,0.2);
    border-left-color: #e74c3c;
}
