/* ===================================================================
   NordChefs – Ergänzungen zu style.css
   Stand: September 2026 (Update-Paket 2026-09)

   Diese Datei wird NACH css/style.css geladen und ergänzt sie nur.
   style.css selbst wird nicht verändert — so bleibt das bestehende
   Design unangetastet und dieses Paket ist gefahrlos einspielbar.

   Inhalt
   1. Honeypot (unsichtbares Spamschutz-Feld)
   2. Formular-Fehlerzustände
   3. Ladezustände für Buttons
   4. Sticky CTA für Mobilgeräte
   5. Zusätzlicher Breakpoint für kleine Handys
   6. Hilfsklassen für 404- und Danke-Seite
   =================================================================== */


/* 1. Honeypot ----------------------------------------------------- */
/* Für Menschen unsichtbar, für Bots ein verlockendes Feld.
   Bewusst nicht display:none — manche Bots erkennen das. */
.hp-field {
    position: absolute !important;
    left: -9999px !important;
    top: auto !important;
    width: 1px !important;
    height: 1px !important;
    overflow: hidden !important;
}


/* 2. Formular-Fehlerzustände -------------------------------------- */
.field-error {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    line-height: 1.4;
    color: var(--red, #CC201F);
}

.field-error::before {
    content: "▲ ";
    font-size: 10px;
    vertical-align: 1px;
}

input.has-error,
select.has-error,
textarea.has-error {
    border-color: var(--red, #CC201F) !important;
    background-color: rgba(204, 32, 31, 0.05);
}

input.has-error:focus,
select.has-error:focus,
textarea.has-error:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(204, 32, 31, 0.25);
}

/* Checkbox-Fehler: der Rahmen allein ist zu unauffällig */
input[type="checkbox"].has-error {
    outline: 2px solid var(--red, #CC201F);
    outline-offset: 2px;
}


/* 3. Ladezustände -------------------------------------------------- */
button.is-loading,
.btn-primary.is-loading {
    position: relative;
    cursor: progress;
    opacity: 0.85;
    padding-left: 38px;
}

button.is-loading::before,
.btn-primary.is-loading::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 50%;
    width: 14px;
    height: 14px;
    margin-top: -7px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ec-spin 0.7s linear infinite;
}

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

/* Wer Bewegung reduziert haben möchte, bekommt keinen drehenden Kreis */
@media (prefers-reduced-motion: reduce) {
    button.is-loading::before,
    .btn-primary.is-loading::before {
        animation: none;
        border-top-color: rgba(255, 255, 255, 0.8);
    }
}


/* 4. Sticky CTA für Mobilgeräte ------------------------------------ */
/* Das Verkaufsversprechen ist die schnelle Reaktion — Anrufen und
   WhatsApp müssen deshalb auf dem Handy immer erreichbar sein. */
.sticky-cta {
    display: none;
}

@media (max-width: 768px) {
    .sticky-cta {
        display: flex;
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 900;
        gap: 1px;
        background: rgba(27, 42, 74, 0.10);
        border-top: 1px solid rgba(27, 42, 74, 0.16);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
        padding-bottom: env(safe-area-inset-bottom, 0);
    }

    .sticky-cta-item {
        flex: 1;
        padding: 14px 6px;
        text-align: center;
        font-size: 14px;
        font-weight: 600;
        text-decoration: none;
        color: #FFFFFF;
        background: var(--navy-dark, #1B2A4A);
        white-space: nowrap;
    }

    .sticky-cta-item:active {
        filter: brightness(1.25);
    }

    .sticky-cta-primary {
        background: var(--red, #CC201F);
        color: #fff;
    }

    /* Platz schaffen, damit die Leiste den Footer nicht überdeckt */
    body {
        padding-bottom: 60px;
    }

    /* Den schwebenden WhatsApp-Button aus js/extras.js anheben,
       damit er nicht auf der Leiste klebt. Über den Link erkannt,
       weil die Klasse dort nicht bekannt ist. */
    a[href*="wa.me"],
    a[href*="api.whatsapp.com"] {
        bottom: 84px !important;
    }
}


/* 5. Zusätzlicher Breakpoint für kleine Handys --------------------- */
/* style.css bricht erst bei 768px um. Darunter wird es eng. */
@media (max-width: 480px) {
    .hero img {
        height: 150px !important;
    }

    h1 {
        font-size: 26px !important;
        line-height: 1.25 !important;
    }

    h2 {
        font-size: 22px !important;
    }

    .section,
    .section-alt .section {
        padding-left: 16px;
        padding-right: 16px;
    }

    .card {
        padding: 18px !important;
    }

    /* Formularraster einspaltig */
    .form-grid {
        display: block !important;
    }

    .form-grid .form-group {
        margin-bottom: 14px;
    }

    /* Tippfreundliche Eingabefelder, 16px verhindert das
       Auto-Zoom von iOS beim Fokussieren */
    input,
    select,
    textarea {
        font-size: 16px !important;
        min-height: 44px;
    }

    .usp-bar {
        flex-wrap: wrap;
        gap: 8px;
        font-size: 13px;
    }

    .modal {
        padding: 18px !important;
        max-height: 88vh;
        overflow-y: auto;
    }

    /* Lange Rechtstexte: Tabellen und Codeblöcke dürfen scrollen,
       die Seite selbst nicht */
    .legal table {
        display: block;
        overflow-x: auto;
        max-width: 100%;
    }
}

/* Nie horizontal scrollen, egal wie schmal */
html,
body {
    max-width: 100%;
    overflow-x: hidden;
}


/* 6. Hilfsklassen für 404- und Danke-Seite -------------------------- */
.status-page {
    max-width: 640px;
    margin: 0 auto;
    padding: 72px 20px 96px;
    text-align: center;
}

.status-code {
    font-size: 64px;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -2px;
    color: var(--red, #CC201F);
    margin-bottom: 8px;
}

.status-page h1 {
    font-size: 28px;
    margin-bottom: 14px;
}

.status-page p {
    color: var(--gray300, #44536E);
    line-height: 1.7;
    margin-bottom: 12px;
}

.status-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
    margin-top: 28px;
}

.status-actions a {
    display: inline-block;
    padding: 13px 22px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
}

.status-btn-primary {
    background: var(--red, #CC201F);
    color: #fff;
}

.status-btn-secondary {
    background: transparent;
    color: var(--ink, #1B2A4A);
    border: 1px solid rgba(27, 42, 74, 0.26);
}

.status-note {
    margin-top: 32px;
    padding-top: 22px;
    border-top: 1px solid rgba(27, 42, 74, 0.14);
    font-size: 14px;
    color: var(--gray500, #5B6983);
}


/* 7. Hinweisbalken der Testfassung --------------------------------- */
/* Max und Ary muessen auf einen Blick sehen, dass sie nicht auf der
   echten Seite sind. Der Balken wird von js/app.js eingehaengt, und
   zwar nur auf test.nordchefs.de - auf der Liveseite entsteht er nie. */
.test-balken {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100000;
    background: repeating-linear-gradient(
        45deg, #f0b400, #f0b400 12px, #d99f00 12px, #d99f00 24px
    );
    color: #1B2A4A;
    font-weight: 700;
    font-size: 13px;
    line-height: 1.35;
    letter-spacing: 0.01em;
    text-align: center;
    padding: 8px 16px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.test-balken strong {
    display: inline-block;
    background: #1B2A4A;
    color: #fff;
    padding: 1px 8px;
    border-radius: 3px;
    margin-right: 8px;
}

@media (max-width: 480px) {
    .test-balken {
        font-size: 11px;
        padding: 6px 10px;
    }
}


/* 8. Feld ueber die ganze Breite + Hinweis unter einem Feld --------- */
.form-group-weit {
    grid-column: 1 / -1;
}

.feld-hinweis {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    line-height: 1.4;
    color: var(--gray300, #44536E);
}


/* ---------------------------------------------------------------
   AGB-Zeile und Dialogfenster (Rueckmeldung Max, 13.10.2026)

   Die Zustimmungszeile stand in einem Flex-Container ohne
   min-width:0. Ein Flex-Kind darf von sich aus nicht schmaler
   werden als sein Inhalt - deshalb lief der lange Satz rechts aus
   dem Bild, statt umzubrechen.
   --------------------------------------------------------------- */
label[for="agbCheck"],
label[for="kochAgbCheck"] {
    min-width: 0;
    flex: 1 1 auto;
    overflow-wrap: anywhere;
}

/* Im Dialog nie seitlich scrollen muessen */
.modal {
    overflow-x: hidden;
}

/* Das Dialogfenster soll beim Ausfuellen nicht wegrutschen:
   die Seite dahinter wird festgehalten, sobald ein Dialog offen ist.
   Den Schalter setzt openModal() in js/app.js. */
body.modal-offen {
    overflow: hidden;
}
