/* BAUER IT SERVICE - Contact Form & Button Fixes */

/* ===== Anruf-Button Fix ===== */
.btn-outline,
a[href^="tel:"] .btn {
    background-color: var(--primary-red) !important;
    color: var(--white) !important;
    border: 2px solid var(--primary-red) !important;
}

.btn-outline:hover,
a[href^="tel:"] .btn:hover {
    background-color: var(--primary-red-hover) !important;
    border-color: var(--primary-red-hover) !important;
    color: var(--white) !important;
}

/* Spezifischer Fix für Anruf-Button */
a[href^="tel:"] {
    text-decoration: none;
}

a[href^="tel:"] .btn,
.btn.btn-call {
    background-color: var(--primary-red) !important;
    color: var(--white) !important;
    border: none !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

a[href^="tel:"] svg {
    fill: var(--white) !important;
}

/* ===== Kontaktformular Mobile Optimierung ===== */

/* Mobile Breakpoint */
@media (max-width: 768px) {
    /* Contact Grid auf Mobile einspaltig */
    .section > .container > div[style*="grid"] {
        display: block !important;
        max-width: 100% !important;
    }

    .section > .container > div[style*="grid"] > div {
        margin-bottom: 3rem;
    }

    /* Form Styling Mobile */
    #contact-form {
        max-width: 100%;
    }

    .form-group {
        margin-bottom: 1.5rem;
    }

    .form-label {
        display: block;
        margin-bottom: 0.5rem;
        font-weight: 500;
        color: var(--dark);
        font-size: 0.95rem;
    }

    .form-control {
        width: 100%;
        padding: 14px 16px !important;
        font-size: 16px !important; /* Verhindert iOS Zoom */
        border: 1px solid var(--border-gray);
        border-radius: var(--border-radius);
        background: var(--white);
        transition: var(--transition);
        -webkit-appearance: none; /* iOS Fix */
        -moz-appearance: none;
        appearance: none;
    }

    .form-control:focus {
        outline: none;
        border-color: var(--primary-red);
        box-shadow: 0 0 0 3px rgba(198, 40, 40, 0.1);
    }

    /* Textarea spezifisch */
    textarea.form-control {
        min-height: 120px;
        resize: vertical;
        font-family: inherit;
    }

    /* Checkbox Container Mobile */
    .form-checkbox {
        display: flex;
        align-items: flex-start;
        gap: 12px;
        margin: 1.5rem 0;
    }

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

    .form-checkbox label {
        font-size: 0.9rem;
        line-height: 1.5;
        cursor: pointer;
    }

    .form-checkbox label a {
        color: var(--primary-red);
        text-decoration: underline;
    }

    /* Submit Button Mobile */
    #contact-form button[type="submit"] {
        width: 100%;
        padding: 14px 24px;
        font-size: 1rem;
        margin-top: 1rem;
        min-height: 48px; /* Touch Target */
    }

    /* Contact Info Box Mobile */
    div[style*="background: var(--light-gray)"] {
        padding: 1.5rem !important;
        margin-bottom: 1.5rem !important;
    }

    /* Contact Details Mobile */
    div[style*="display: flex"][style*="gap: 1rem"] {
        margin-bottom: 1.25rem !important;
    }

    /* Alert Messages Mobile */
    .alert {
        padding: 1rem;
        margin-bottom: 1.5rem;
        border-radius: var(--border-radius);
        font-size: 0.95rem;
    }

    .alert-success {
        background: rgba(76, 175, 80, 0.1);
        border: 1px solid var(--success);
        color: var(--success);
    }

    .alert-error {
        background: rgba(244, 67, 54, 0.1);
        border: 1px solid var(--error);
        color: var(--error);
    }

    /* Business Hours Mobile */
    .business-hours {
        font-size: 0.9rem;
    }

    .business-hours li {
        padding: 0.5rem 0;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    /* Icons in Contact Info */
    svg[width="24"] {
        width: 20px !important;
        height: 20px !important;
    }

    /* Contact Info Heading */
    h3 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }

    /* Links in Contact Info */
    a[href^="mailto:"],
    a[href^="tel:"] {
        word-break: break-word;
        color: var(--primary-red);
    }
}

/* Sehr kleine Geräte */
@media (max-width: 360px) {
    .form-control {
        padding: 12px 14px !important;
        font-size: 16px !important;
    }

    .form-checkbox {
        gap: 10px;
    }

    .form-checkbox input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }

    .form-checkbox label {
        font-size: 0.85rem;
    }

    #contact-form button[type="submit"] {
        padding: 12px 20px;
        font-size: 0.95rem;
    }
}

/* Tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Contact Grid auf Tablets auch einspaltig für bessere Lesbarkeit */
    .section > .container > div[style*="grid-template-columns: 1fr 1fr"] {
        grid-template-columns: 1fr !important;
        max-width: 600px !important;
        margin: 0 auto !important;
    }

    .form-control {
        padding: 12px 16px;
    }
}

/* Fix für inline styles Override */
@media (max-width: 768px) {
    /* Force Override für Grid Layout */
    div[style*="display: grid"][style*="grid-template-columns: 1fr 1fr"] {
        display: block !important;
    }

    div[style*="display: grid"][style*="grid-template-columns: 1fr 1fr"] > div {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* Accessibility Improvements */
.form-control:focus-visible {
    outline: 2px solid var(--primary-red);
    outline-offset: 2px;
}

.form-error {
    display: block;
    color: var(--error);
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

/* Loading State für Button */
button[type="submit"][disabled] {
    opacity: 0.6;
    cursor: not-allowed;
}

button[type="submit"].loading::after {
    content: "...";
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: "."; }
    40% { content: ".."; }
    60%, 100% { content: "..."; }
}

/* Print Styles für Kontaktseite */
@media print {
    #contact-form {
        display: none;
    }

    div[style*="background: var(--light-gray)"] {
        border: 1px solid #000;
        background: none !important;
    }
}