/* === WrkDrvn Contact — Zweispaltiges Layout ============================ */

/* Theme-Container .wd-post (max-width:760px) zurücksetzen, wenn das
   Kontakt-Formular enthalten ist, damit die volle Theme-Breite (1440px)
   genutzt wird — analog zur Startseite. */
.wd-post:has(.wd-contact-page) {
    max-width: none;
    padding: 0;
}

/* WICHTIG: Auch .wd-post__content resetten — das Theme setzt hier
   max-width: 800px (Lese-Spalte für Blog/Seiten). Ohne diesen Reset
   wird das gesamte Kontakt-Layout auf 800px beschnitten. */
.wd-post:has(.wd-contact-page) .wd-post__content {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

/* Seiten-Titel (<h1>) ausblenden, wenn das Kontaktformular enthalten ist
   (Sicherheit-Fallback zur bedingten Ausgabe in page.php). */
.wd-post:has(.wd-contact-page) > h1 {
    display: none;
}

/* Fallback für Browser ohne :has()-Support: page-id des Shortcode-Trägers.
   Wird via Body-Klasse der Kontakt-Seite (page-id-9) gematcht. */
body.page-id-9 .wd-post {
    max-width: none;
    padding: 0;
}

body.page-id-9 .wd-post .wd-post__content {
    max-width: none !important;
    margin: 0 !important;
    padding: 0 !important;
}

body.page-id-9 .wd-post > h1 {
    display: none;
}

/* Theme-Variablen übernehmen, falls vorhanden (Fallback 1440px).
   Hoch-spezifische Selector + !important, damit das Theme-CSS
   (Vollbreite-Regeln für .wd-main/.wd-post) den Container nicht beschrneidet. */
body:not(.wd-front) .wd-contact-page,
body.page .wd-contact-page {
    --wdc-container: var(--wd-container, 1440px);
    width: 100% !important;
    max-width: 100% !important;
    padding: 100px clamp(24px, 5vw, 80px) !important;
    box-sizing: border-box !important;
    margin: 0 auto;
    min-height: 80vh;
}

body:not(.wd-front) .wd-contact-page .wd-contact-page__grid,
body.page .wd-contact-page .wd-contact-page__grid {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 60px !important;
    align-items: start !important;
    width: 100% !important;
    max-width: 1400px !important; /* begrenzt das Grid auf eine sinnvolle Breite */
    margin: 0 auto !important;    /* zentriert das Grid auf dem Bildschirm */
}

/* ─── LINKE SPALTE: Slogan + Animation (gestapelt) ─────────────────── */
.wd-contact-page__visual {
    display: flex;
    flex-direction: column; /* stapelt Slogan und Canvas untereinander */
    justify-content: center;
    gap: 40px; /* Abstand zwischen Text und Animation */
}

.wd-contact-page__canvas {
    position: relative; /* nicht mehr absolute — nimmt eigenen Platz im Flow ein */
    width: 100%;
    height: 300px; /* feste Höhe für die Animation */
    display: block;
    pointer-events: none;
    /* NeuronFire steuert ihre eigene Farbe — kein opacity hier */
}

.wd-contact-page__slogan {
    position: relative;
    z-index: 2;
    padding: 0 40px;
}

.wd-contact-page__slogan-eyebrow {
    font-family: 'JetBrains Mono', monospace;
    font-size: 14px;
    color: #6366f1;
    text-transform: uppercase;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.wd-contact-page__slogan-title {
    font-family: 'Inter', sans-serif;
    font-size: 48px;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.1;
    margin: 0 0 24px 0;
}

.wd-contact-page__slogan-accent {
    color: #6366f1;
}

.wd-contact-page__slogan-text {
    font-family: 'Inter', sans-serif;
    font-size: 18px;
    color: #888;
    line-height: 1.6;
    max-width: 400px;
    margin: 0;
}

/* ─── RECHTE SPALTE: Form-Container ─────────────────────────────────── */
.wd-contact-page__form-wrap {
    background: #111118;
    border: 1px solid #222;
    border-radius: 8px;
    padding: 40px;
    overflow: hidden; /* verhindert, dass Kinder den Container sprengen */
    min-width: 0; /* wichtig für Grid-Children */
}

.wd-contact-page__form-title {
    font-family: 'Inter', sans-serif;
    font-size: 24px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 32px 0;
    padding-bottom: 16px;
    border-bottom: 1px solid #222;
}

/* ─── Labels + Inputs ──────────────────────────────────────────────── */
.wd-contact-page label {
    display: block;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #888;
    margin-bottom: 6px;
}

.wd-contact-page input[type="text"],
.wd-contact-page input[type="email"],
.wd-contact-page input[type="tel"],
.wd-contact-page textarea {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    background: #0a0a0f;
    border: 1px solid #222;
    border-radius: 4px;
    padding: 12px 16px;
    color: #e0e0e0;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    margin-bottom: 20px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.wd-contact-page input:focus,
.wd-contact-page textarea:focus {
    outline: none;
    border-color: #6366f1;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2);
}

.wd-contact-page input::placeholder,
.wd-contact-page textarea::placeholder {
    color: #555;
}

.wd-contact-page textarea {
    min-height: 100px;
    resize: vertical;
}

/* Nachricht-Feld größer */
.wd-contact-page textarea[name="wd_message"] {
    min-height: 200px;
    resize: vertical;
}

/* ─── Feld-Zeilen (Straße/Nr, PLZ/Ort) ─────────────────────────────── */
.wd-contact-page .wd-field-row {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    width: 100%;
}

.wd-contact-page .wd-field-row .wd-field-grow {
    flex: 1;
    min-width: 0; /* verhindert Flex-Überlauf */
}

.wd-contact-page .wd-field-row .wd-field-small {
    width: 100px;
    flex-shrink: 0;
}

/* Inputs in den Rows brauchen kein margin-bottom */
.wd-contact-page .wd-field-row input {
    margin-bottom: 0 !important;
}

.wd-contact-page .wd-field-row .wd-field-error {
    margin-top: 6px;
    margin-bottom: 0;
}

/* ─── Radio-Buttons (vertikal, als klickbare Karten) ───────────────── */
.wd-contact-page .wd-radio-group {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.wd-contact-page .wd-radio-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 10px 14px;
    border: 1px solid #222;
    border-radius: 4px;
    transition: border-color 0.2s, background 0.2s;
    margin-bottom: 0;
}

.wd-contact-page .wd-radio-option:hover {
    border-color: #444;
    background: rgba(99, 102, 241, 0.05);
}

.wd-contact-page .wd-radio-option input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #444;
    border-radius: 50%;
    margin: 0;
    flex-shrink: 0;
    position: relative;
    cursor: pointer;
    background: #0a0a0f;
    transition: border-color 0.2s;
}

.wd-contact-page .wd-radio-option input[type="radio"]:checked {
    border-color: #6366f1;
}

.wd-contact-page .wd-radio-option input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 10px;
    height: 10px;
    background: #6366f1;
    border-radius: 50%;
}

.wd-contact-page .wd-radio-label {
    font-size: 15px;
    color: #ccc;
}

/* ─── Datei-Upload ─────────────────────────────────────────────────── */
.wd-contact-page .wd-file-upload {
    margin-bottom: 20px;
}

.wd-contact-page .wd-file-upload input[type="file"] {
    width: 100%;
    padding: 10px;
    background: #0a0a0f;
    border: 1px dashed #333;
    border-radius: 4px;
    color: #888;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    margin-bottom: 0;
}

.wd-contact-page .wd-file-upload input[type="file"]::file-selector-button {
    background: #222;
    border: 1px solid #333;
    color: #ccc;
    padding: 8px 16px;
    border-radius: 4px;
    margin-right: 12px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    transition: background 0.2s;
}

.wd-contact-page .wd-file-upload input[type="file"]::file-selector-button:hover {
    background: #2a2a35;
}

.wd-contact-page .wd-file-upload input[type="file"]::-webkit-file-upload-button {
    background: #222;
    border: 1px solid #333;
    color: #ccc;
    padding: 8px 16px;
    border-radius: 4px;
    margin-right: 12px;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
}

.wd-contact-page .wd-file-hint {
    font-size: 12px;
    color: #555;
    margin-top: 6px;
}

/* ─── Checkbox Datenschutz ─────────────────────────────────────────── */
.wd-contact-page .wd-checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 24px;
}

.wd-contact-page .wd-checkbox-wrap input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid #444;
    border-radius: 4px;
    margin: 2px 0 0 0;
    flex-shrink: 0;
    cursor: pointer;
    position: relative;
    background: #0a0a0f;
    transition: background 0.2s, border-color 0.2s;
}

.wd-contact-page .wd-checkbox-wrap input[type="checkbox"]:checked {
    background: #6366f1;
    border-color: #6366f1;
}

.wd-contact-page .wd-checkbox-wrap input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
    line-height: 1;
}

.wd-contact-page .wd-checkbox-label {
    font-size: 14px;
    color: #888;
    line-height: 1.4;
    margin-bottom: 0;
    cursor: pointer;
}

.wd-contact-page .wd-checkbox-label a {
    color: #6366f1;
    text-decoration: underline;
}

/* ─── Submit-Button ────────────────────────────────────────────────── */
.wd-contact-page .wd-submit-btn {
    width: 100%;
    background: #6366f1;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 16px 32px;
    font-family: 'Inter', sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

.wd-contact-page .wd-submit-btn:hover,
.wd-contact-page .wd-submit-btn:focus {
    background: #7577f5;
    outline: none;
}

.wd-contact-page .wd-submit-btn:active {
    transform: scale(0.98);
}

/* ─── Honeypot (versteckt) ─────────────────────────────────────────── */
.wd-contact-page .wd-honeypot {
    display: none !important;
    visibility: hidden !important;
    position: absolute !important;
    left: -9999px !important;
}

/* ─── Erfolgs-/Fehlermeldungen ─────────────────────────────────────── */
.wd-contact-page .wd-message {
    padding: 16px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    line-height: 1.5;
}

.wd-contact-page .wd-message--success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
}

.wd-contact-page .wd-message--error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #ef4444;
}

/* ─── Feld-Fehler ──────────────────────────────────────────────────── */
.wd-contact-page .wd-field-error {
    color: #ef4444;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    margin-top: -14px;
    margin-bottom: 16px;
}

/* ─── Sonstiges-Freitextfeld (bedingt) ─────────────────────────────── */
.wd-contact-page .wd-interest-other-field {
    display: none;
    margin-top: -8px;
    margin-bottom: 20px;
}

.wd-contact-page .wd-interest-other-field.visible {
    display: block;
}

/* ─── RESPONSIVE ───────────────────────────────────────────────────── */
@media (max-width: 900px) {
    body:not(.wd-front) .wd-contact-page,
    body.page .wd-contact-page {
        padding: 40px 24px !important;
    }

    body:not(.wd-front) .wd-contact-page .wd-contact-page__grid,
    body.page .wd-contact-page .wd-contact-page__grid {
        grid-template-columns: 1fr !important;
        gap: 40px !important;
    }

    .wd-contact-page__canvas {
        height: 220px;
    }

    .wd-contact-page__slogan {
        padding: 0 16px;
    }

    .wd-contact-page__slogan-title {
        font-size: 32px;
    }

    .wd-contact-page__form-wrap {
        padding: 24px;
    }
}

@media (max-width: 480px) {
    .wd-contact-page__slogan-title {
        font-size: 26px;
    }

    .wd-contact-page__form-wrap {
        padding: 20px;
    }
}
