/**
 * FORMULAR CSS 7.2 - Clean Design
 * /pages/formular/formular.css
 * 
 * - Step 1 FEST auf Blau #00aeef
 * - Steps 2-5 dynamisch (nach Filialauswahl)
 * - Standort-Text schwarz (nicht dynamisch)
 * - Keine Emoji-Icons mehr
 * - Container border-radius 12px
 * - Card-Grid 3 Spalten
 * - NEU v5.5: Bubble-Logo unten links entfernt (.container::before)
 */

:root {
    --primary-color: #00aeef;
    --primary-dark: #0098d4;
    --primary-light: rgba(0, 174, 239, 0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Honeypot - Anti-Spam (unsichtbares Feld) */
.hp-field {
    position: absolute !important;
    left: -5000px !important;
    width: 1px !important;
    height: 1px !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

html {
    overflow: hidden;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: transparent;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

/* HEADER */
.header { 
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white; 
    padding: 30px; 
    text-align: center;
}

.header h1 { 
    font-size: 1.8rem; 
    margin-bottom: 5px; 
}

.header p {
    font-size: 0.95rem;
    opacity: 0.9;
}

/* PROGRESS BAR - HORIZONTAL */
.progress-bar {
    display: flex;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
    padding: 0;
    margin: 0;
    position: relative;
    z-index: 2;
}

.progress-step {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 8px;
    background: #f8f9fa;
    border-right: 1px solid #e0e0e0;
    transition: all 0.3s ease;
    cursor: default;
    position: relative;
}

/* Klickbare Steps (done/active außer Step 5) */
.progress-step.done[data-step]:not([data-step="5"]),
.progress-step.active[data-step]:not([data-step="5"]) {
    cursor: pointer;
}

.progress-step.done[data-step]:not([data-step="5"]):hover,
.progress-step.active[data-step]:not([data-step="5"]):hover {
    opacity: 0.8;
}

.progress-step:last-child {
    border-right: none;
}

/* Step 1 bleibt IMMER blau (#00aeef) - FEST, keine Variable! */
.progress-step[data-step="1"] {
    background: #00aeef !important;
    color: white !important;
}

.progress-step[data-step="1"] .step-number {
    background: white !important;
    color: #00aeef !important;
    border-color: white !important;
}

.progress-step[data-step="1"] .step-label {
    color: white !important;
    font-weight: 600 !important;
}

/* Aktiver Step (außer Step 1) */
.progress-step.active:not([data-step="1"]) {
    background: #e3f2fd;
    color: var(--primary-color);
}

/* Erledigter Step - nutzt Filialfarbe */
.progress-step.done {
    background: var(--primary-light);
}

.step-number {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: white;
    border: 2px solid #ddd;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.75rem;
    margin-right: 6px;
    transition: all 0.3s ease;
    opacity: 0.7;
}

.progress-step.active:not([data-step="1"]) .step-number {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    opacity: 1;
}

.progress-step.done .step-number {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    opacity: 1;
}

.step-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: #999;
    transition: color 0.3s ease;
}

.progress-step.active:not([data-step="1"]) .step-label {
    color: var(--primary-color);
    font-weight: 600;
}

.progress-step.done .step-label {
    color: var(--primary-color);
}

/* FORM STEPS */
.form-step {
    display: none;
}

.form-step.active {
    display: block;
}

.step-content {
    padding: 30px;
    position: relative;
    z-index: 2;
}

/* BUBBLE-LOGO ENTFERNT - war hier mit .container::before */

.step-content h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
}

/* CARDS */
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.card-grid-products {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-bottom: 25px;
}

.card {
    position: relative;
}

.card input {
    position: absolute;
    opacity: 0;
}

.card-body {
    border: 3px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    text-align: left;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 180px;
}

.card-body-centered {
    text-align: center !important;
    min-height: 140px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.card-body:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card input:checked + .card-body {
    border-color: var(--primary-color);
    background: var(--primary-light);
}

.card-icon {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* Service Icons (Bilder statt Emojis) */
.service-icon {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 15px;
}

/* Termin-Link Karte (ohne Radio) */
.card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
}

.card-link .card-body {
    cursor: pointer;
}

.card-link:hover .card-body {
    border-color: var(--primary-color);
    background: var(--primary-light);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.filial-logo {
    max-width: 100px;
    height: auto;
    margin-bottom: 12px;
    display: block;
}

.standort {
    color: #333;
    margin: 5px 0;
    font-size: 0.95rem;
}

.oeffnungszeiten {
    color: #666;
    font-size: 0.85rem;
    margin-top: 8px;
}

/* PRODUCT FORMS */
.product-form {
    display: none !important;
}

.product-form.active {
    display: block !important;
}

/* FORM ELEMENTS */
.form-group {
    margin-bottom: 18px;
    max-width: 480px;
}

.form-row .form-group {
    max-width: none;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.form-input {
    width: 100%;
    padding: 11px;
    border: 3px solid #ddd;           /* wie .card-body */
    border-radius: 10px;               /* wie .card-body */
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;         /* wie .card-body */
}

.form-input:focus {
    border-color: var(--primary-color);
    transform: translateY(-2px);       /* wie .card-body:hover */
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);  /* wie .card-body:hover */
    outline: none;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.form-group-narrow {
    max-width: 480px;
}

/* Freitextfelder (textareas) immer volle Breite */
.form-group:has(textarea) {
    max-width: none;
}

.hint {
    font-size: 0.85rem;
    color: #666;
    margin-top: 4px;
    font-style: italic;
}

.required {
    color: #f44336;
}

/* RADIO GROUPS */
.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    margin-top: 8px;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-weight: normal;
}

.radio-group input[type="radio"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

/* INFO BOX */
.info-box {
    background: #e3f2fd;
    border-left: 4px solid var(--primary-color);
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 4px;
    font-size: 0.9rem;
}

.info-box strong {
    display: block;
    margin-bottom: 5px;
    color: var(--primary-color);
}

/* Termin-iframe */
.iframe-container {
    width: 100%;
    margin: 20px 0;
}

.iframe-container iframe {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

/* BUTTONS */
.step-buttons {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    position: relative;
    z-index: 3;
}

.btn {
    padding: 12px 28px;
    border: none;
    border-radius: 6px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.3s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.btn-secondary {
    background: #f0f0f0;
    color: #666;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-submit {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    color: white;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255,107,107,0.3);
}

/* SUMMARY */
.summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    font-size: 0.95rem;
}

.summary-filiale {
    display: flex;
    align-items: center;
    gap: 15px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
    border: 2px solid var(--primary-color);
}

.summary-logo {
    width: 80px;
    height: auto;
}

.summary-filiale h3 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--primary-color);
}

.summary-filiale p {
    margin: 5px 0 0 0;
    color: #666;
}

.summary-section {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 15px;
    border: 1px solid #e0e0e0;
}

.summary-section strong {
    display: block;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.1rem;
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
}

.summary-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

.summary-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: top;
}

.summary-table td:first-child {
    font-weight: bold;
    color: #666;
    width: 35%;
}

.summary-table td:last-child {
    color: #333;
}

.summary-table tr:last-child td {
    border-bottom: none;
}

.summary-message {
    background: #f8f9fa;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
    line-height: 1.6;
}

/* DSGVO */
.dsgvo {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid #ddd;
    margin-bottom: 20px;
}

.dsgvo label {
    display: flex;
    align-items: start;
    gap: 10px;
    font-weight: normal;
    cursor: pointer;
}

.dsgvo input {
    margin-top: 3px;
}

.dsgvo a {
    color: var(--primary-color);
    text-decoration: underline;
}

/* INLINE VALIDATION ERRORS */
.validation-error {
    color: #c62828;
    font-size: 0.85rem;
    margin-top: 6px;
    padding: 6px 10px;
    background: #fee;
    border-radius: 4px;
    border-left: 3px solid #f44336;
    animation: fadeIn 0.3s ease;
}

.has-error .form-input,
.has-error input,
.has-error select,
.has-error textarea {
    border-color: #f44336 !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ERROR & SUCCESS */
.error {
    background: #fee;
    color: #c62828;
    padding: 15px;
    margin-bottom: 20px;
    border-radius: 8px;
    border-left: 4px solid #f44336;
}

.success-page {
    text-align: center;
    padding: 60px 30px;
    position: relative;
    z-index: 2;
}

.success-icon {
    width: 80px;
    height: 80px;
    background: #4caf50;
    color: white;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 3rem;
    margin-bottom: 20px;
}

/* ============================================================================
   SECTION HEADERS - Trennlinien zwischen Formularbereichen
   ============================================================================ */

.section-header {
    font-weight: 600;
    font-size: 1.1rem;
    color: #333;
    margin: 25px 0 15px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--primary-color);
}

/* ============================================================================
   SUMMARY - 2-Spalten-Layout auf Desktop
   ============================================================================ */

@media (min-width: 769px) {
    .summary {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .summary-filiale {
        grid-column: 1 / -1;
        order: 1;
    }

    .summary-service {
        order: 2;
    }

    .summary-contact {
        order: 3;
    }

    .summary-details {
        grid-column: 1 / -1;
        order: 4;
    }

    .summary-remarks {
        grid-column: 1 / -1;
        order: 5;
    }
}

/* ============================================================================
   RESPONSIVE - Tablets (768px und kleiner)
   ============================================================================ */

@media (max-width: 768px) {
    /* Wizard-Steps auf Mobile komplett ausblenden */
    .progress-bar {
        display: none;
    }

    .card-grid,
    .card-grid-products,
    .form-row {
        grid-template-columns: 1fr;
    }

    .step-buttons {
        flex-direction: column-reverse;
    }

    .btn {
        width: 100%;
    }

    .card-body {
        min-height: auto;
        padding: 18px;
    }

    .card-body h3 {
        font-size: 16px;
    }

    .card-body p {
        font-size: 13px;
    }

    .filial-logo {
        max-width: 60px;
    }

    .service-icon {
        width: 60px;
        height: 60px;
    }

    .card-body-centered {
        padding: 15px;
    }

    .card-body-centered h3 {
        font-size: 15px;
        margin-top: 8px;
    }

    .radio-group {
        flex-direction: column;
        gap: 10px;
    }

    .form-group-narrow {
        max-width: 100%;
    }

    .step-content {
        padding: 15px;
    }

    /* Summary einspaltig auf Mobile */
    .summary {
        display: block;
    }
}

/* Smartphones (480px und kleiner) */
@media (max-width: 480px) {
    .container {
        border-radius: 0;
        box-shadow: none;
    }

    .header {
        padding: 20px 15px;
    }

    .card-body {
        padding: 12px;
    }

    .card-body h3 {
        font-size: 14px;
    }

    .card-body p {
        font-size: 12px;
        line-height: 1.3;
    }

    .filial-logo {
        max-width: 50px;
    }

    .service-icon {
        width: 50px;
        height: 50px;
    }

    .card-body-centered {
        padding: 12px 8px;
    }

    .card-body-centered h3 {
        font-size: 13px;
        margin-top: 6px;
    }

    .step-content {
        padding: 12px;
    }

    .step-content h2 {
        font-size: 18px;
        margin-bottom: 12px;
    }
}

/* Sehr kleine Displays (390px und kleiner) */
@media (max-width: 390px) {
    .card-grid {
        gap: 10px;
    }

    .card-grid-products {
        gap: 8px;
        grid-template-columns: repeat(2, 1fr);
    }

    .btn {
        padding: 10px 16px;
        font-size: 14px;
    }
}

/* ============================================================================
   CONTAINER - Sauberes Layout mit Schatten und runden Ecken
   ============================================================================ */

.container {
    width: 100%;

    background: white;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    border-radius: 12px;
    overflow: hidden;
}

body {
    height: auto;
    min-height: 100%;
    overflow: hidden;
}