/* =========================================================
   Erstgespräch Buchung – Frontend Styles v1.8
   Fixes: hover-on-touch, gap fallback, box-sizing, transition
========================================================= */

/* Box-sizing global für das Widget */
.egb-wrap *,
.egb-wrap *::before,
.egb-wrap *::after {
    box-sizing: border-box;
}

.egb-wrap {
    max-width: 520px;
    margin: 0 auto;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    color: #1a1a2e;
}

/* Schritte */
.egb-step-title {
    font-size: 1.25rem !important;
    font-weight: 600;
    margin-bottom: 18px;
    color: #1a1a2e;
}
.egb-hidden { display: none !important; }

/* Datum-Gruppe */
.egb-date-group { margin-bottom: 20px; }
.egb-date-label {
    font-size: 13px;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 8px;
}

/* Zeit-Grid: gap mit margin-Fallback für iOS < 14.5 */
.egb-time-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* Zeit-Buttons */
.egb-time-btn {
    padding: 9px 18px;
    border-radius: 8px;
    border: 2px solid #2d6a4f;
    background: #fff;
    color: #2d6a4f;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    /* Nur konkrete Properties animieren, kein 'all' */
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    /* Verhindert ungewollte Text-Selektion beim schnellen Tippen */
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Hover nur auf Geräten mit echter Maus – verhindert "kleben" auf Touch */
@media (hover: hover) {
    .egb-time-btn:hover {
        background: #2d6a4f;
        color: #fff;
    }
}

/* Aktiv-Zustand für Touch-Feedback */
.egb-time-btn:active {
    background: #2d6a4f;
    color: #fff;
}

/* Ausgewählter Termin */
.egb-selected-info {
    background: #f0faf4;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 18px;
    font-size: 14px;
    color: #2d6a4f;
}

/* Formularfelder */
.egb-field { margin-bottom: 14px; }
.egb-field label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #444;
    margin-bottom: 5px;
}
.egb-field input,
.egb-field textarea {
    width: 100%;
    padding: 10px 12px;
    border-radius: 8px;
    border: 1.5px solid #ddd;
    font-size: 14px;
    /* box-sizing bereits global gesetzt, trotzdem explizit für Spezifität */
    box-sizing: border-box;
    transition: border-color 0.15s;
    /* Verhindert ungewolltes Zoom auf iOS beim Fokus (font-size < 16px würde Zoom auslösen) */
    font-size: max(16px, 14px);
}
.egb-field textarea[name="egb_message"] {
    min-height: 120px;
}

/* iOS-Zoom-Fix: input font-size muss ≥ 16px sein; wir nutzen 16px nur fürs Rendering,
   visuell wirkt es durch den Container trotzdem kleiner */
@supports (font-size: max(1px, 1px)) {
    .egb-field input,
    .egb-field textarea {
        font-size: 16px;
    }
}

.egb-field input:focus,
.egb-field textarea:focus {
    outline: none;
    border-color: #2d6a4f;
}

/* Buttons */
.egb-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}
.egb-btn {
    padding: 11px 22px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (hover: hover) {
    .egb-btn:hover { opacity: 0.88; }
}

.egb-btn:active { opacity: 0.78; }

.egb-btn-primary {
    background: #2d6a4f;
    color: #fff;
    flex: 1;
}
.egb-btn-secondary {
    background: #f0f0f0;
    color: #555;
}

/* ICS-Download-Button (ist ein <a>-Tag) */
.egb-btn-ics {
    display: inline-block;
    background: #2d6a4f;
    color: #fff;
    margin-top: 12px;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    transition: opacity 0.15s;
}

@media (hover: hover) {
    .egb-btn-ics:hover {
        color: #fff !important;
        opacity: 0.88;
    }
}

.egb-btn-ics:active {
    opacity: 0.78;
    color: #fff !important;
}

/* Erfolg */
.egb-success {
    text-align: center;
    padding: 30px 20px;
}
.egb-success-icon { font-size: 48px; margin-bottom: 12px; }
.egb-success h3 { font-size: 20px; margin-bottom: 8px; }
.egb-success p { color: #666; font-size: 14px; }

/* Fehler */
.egb-error {
    background: #fef0f0;
    border-left: 4px solid #e74c3c;
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 16px;
    font-size: 14px;
    color: #c0392b;
}

.egb-field select {
    width: 100%;
    padding: 9px 11px;
    border-radius: 8px;
    border: 1.5px solid #ddd;
    font-size: 16px; /* ≥ 16px verhindert iOS-Zoom */
    box-sizing: border-box;
    outline: none;
    background: #fff;
    transition: border-color 0.15s;
    cursor: pointer;
    /* Nativer Pfeil auf iOS sichtbar lassen */
    -webkit-appearance: auto;
    appearance: auto;
}
.egb-field select:focus {
    border-color: #2d6a4f;
}

/* Keine Slots */
.egb-no-slots {
    color: #2d6a4f !important;
    font-style: italic;
    text-align: center !important;
}

/* DSGVO-Checkbox */
.egb-privacy-field {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 14px;
    margin-top: 6px;
}
.egb-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}
.egb-checkbox-label input[type="checkbox"] {
    margin-top: 2px;
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    /* accent-color: moderne Browser bekommen die Markenfarbe,
       ältere (Safari < 15.4) fallen auf System-Standard zurück – korrekt */
    accent-color: #2d6a4f;
    cursor: pointer;
}
.egb-privacy-hint {
    font-size: 12px;
    color: #666;
    margin: 8px 0 0 28px;
    line-height: 1.6;
}
.egb-privacy-hint a {
    color: #2d6a4f;
    text-decoration: underline;
}

/* ── Frontend-Kalender ──────────────────────────────────── */
.egb-fe-cal {
    margin-bottom: 16px;
}

.egb-fe-day {
    transition: background 0.12s, border-color 0.12s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

/* Hover + Skalierung nur auf Pointer-Geräten */
@media (hover: hover) {
    .egb-fe-day:hover {
        background: #2d6a4f !important;
        color: #fff !important;
        border-color: #2d6a4f !important;
        transform: scale(1.06);
    }
}

.egb-fe-day:active {
    background: #2d6a4f !important;
    color: #fff !important;
    border-color: #2d6a4f !important;
}

/* Monatsnavigation */
.egb-nav-btn {
    padding: 6px 14px;
    font-size: 16px;
    line-height: 1;
    border-radius: 8px;
    border: 2px solid #2d6a4f;
    background: #fff;
    color: #2d6a4f;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

@media (hover: hover) {
    .egb-nav-btn:hover:not(:disabled) {
        background: #2d6a4f;
        color: #fff;
    }
}

.egb-nav-btn:active:not(:disabled) {
    background: #2d6a4f;
    color: #fff;
}

.egb-nav-btn:disabled {
    border-color: #ddd;
    color: #ccc;
    background: #f5f5f5;
    cursor: default;
}

/* Fokus-Outline: sichtbar bei Tastatur, unsichtbar bei Maus/Touch */
.egb-nav-btn:focus-visible {
    outline: 2px solid #2d6a4f;
    outline-offset: 2px;
}
.egb-nav-btn:focus:not(:focus-visible) {
    outline: none;
    background: #fff;
    color: #2d6a4f;
}

/* ── Responsive: sehr schmale Screens ──────────────────── */
@media (max-width: 360px) {
    .egb-time-btn {
        padding: 9px 12px;
        font-size: 13px;
    }
    .egb-actions {
        flex-direction: column;
    }
    .egb-btn-secondary {
        order: 2;
    }
}
