﻿/* =========================================================
   PÁGINA DE CONTACTO - ACCESIBLE (WCAG AA/AAA)
   ========================================================= */

/* ========== HERO SECTION ========== */
.contact-hero {
    background: linear-gradient(135deg, #1e40af 0%, #7c3aed 100%);
    color: #ffffff;
    padding: 5rem 0;
    margin-bottom: 3rem;
    text-align: center;
}

    .contact-hero h1 {
        color: #ffffff !important;
        font-weight: 700;
        text-shadow: 0 2px 4px rgba(0,0,0,0.3);
    }

    .contact-hero p {
        color: #e0e7ff;
        font-size: 1.125rem;
    }

/* ========== CARDS ========== */
.contact-card {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 2.5rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid #cbd5e0;
}

    .contact-card:hover {
        transform: translateY(-5px);
        box-shadow: 0 25px 80px rgba(0,0,0,0.15);
    }

/* ========== FORMULARIO ========== */
.form-control,
.form-select {
    border: 2px solid #94a3b8;
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    color: #1f2937;
    background-color: #ffffff;
    font-size: 1rem;
}

    .form-control:focus,
    .form-select:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
        outline: none;
    }

    .form-control:focus-visible,
    .form-select:focus-visible {
        outline: 3px solid #fbbf24;
        outline-offset: 2px;
    }

.form-floating label {
    padding-left: 1rem;
    color: #475569;
    font-weight: 500;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: #1e293b;
}

.form-control::placeholder {
    color: #64748b;
    opacity: 1;
}

/* ========== ÁREA DE CARGA DE ARCHIVOS ========== */
.file-upload-area {
    border: 3px dashed #64748b;
    border-radius: 1rem;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #f8fafc;
}

    .file-upload-area:hover,
    .file-upload-area.dragover {
        border-color: #2563eb;
        background: #eff6ff;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    }

    .file-upload-area:focus-within {
        outline: 3px solid #fbbf24;
        outline-offset: 2px;
        border-color: #2563eb;
    }

.file-upload-icon {
    font-size: 3rem;
    color: #2563eb;
    margin-bottom: 1rem;
}

.file-upload-area p {
    color: #475569;
    font-weight: 500;
}

/* Vista previa de archivos adjuntos */
.attachment-preview {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    background: #f1f5f9;
    border-radius: 0.75rem;
    margin-bottom: 0.5rem;
    border: 1px solid #94a3b8;
}

    .attachment-preview img {
        width: 40px;
        height: 40px;
        object-fit: cover;
        border-radius: 0.5rem;
        margin-right: 1rem;
    }

    .attachment-preview button {
        margin-left: auto;
    }

        .attachment-preview button:focus-visible {
            outline: 2px solid #fbbf24;
            outline-offset: 2px;
        }

/* ========== BOTONES ========== */
.btn-primary {
    background: #2563eb;
    border: 2px solid #1e40af;
    border-radius: 12px;
    padding: 1rem 2rem;
    font-weight: 700;
    transition: all 0.3s ease;
    color: #ffffff;
}

    .btn-primary:hover {
        background: #1e40af;
        transform: translateY(-2px);
        box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
    }

    .btn-primary:focus-visible {
        outline: 3px solid #fbbf24;
        outline-offset: 2px;
        box-shadow: 0 0 0 5px rgba(251, 191, 36, 0.2);
    }

    .btn-primary:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none;
    }

/* ========== CARD DE INFORMACIÓN DE CONTACTO ========== */
.contact-info-card {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
    border-left: 4px solid #2563eb;
    padding: 1.5rem;
    border-radius: 1rem;
    margin-bottom: 1.5rem;
    border: 1px solid #93c5fd;
}

    .contact-info-card h4 {
        color: #1e293b;
        font-weight: 700;
    }

    .contact-info-card p {
        color: #334155;
        font-weight: 500;
    }

    .contact-info-card a {
        color: #1642A2;
        text-decoration: underline;
        font-weight: 600;
    }

        .contact-info-card a:hover {
            color: #0d2b6b;
            background-color: #fef3c7;
        }

/* ========== UTILIDADES DE ACCESIBILIDAD ========== */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* ========== ANUNCIOS DE LECTOR DE PANTALLA - CORREGIDO ========== */
/* SOLO ocultar elementos que tengan AMBOS: aria-live Y visually-hidden */
[aria-live="polite"].visually-hidden,
[aria-live="assertive"].visually-hidden,
.sr-only[aria-live="polite"],
.sr-only[aria-live="assertive"] {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Alternativa: usar un selector más específico para anuncios temporales */
.screen-reader-announcement {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

/* Mensajes de validación */
.invalid-feedback {
    color: #dc2626;
    font-weight: 600;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

.valid-feedback {
    color: #16a34a;
    font-weight: 600;
    font-size: 0.875rem;
    margin-top: 0.5rem;
}

/* =========================================================
   MODO ALTO CONTRASTE (AAA)
   ========================================================= */

body.high-contrast-mode .contact-hero {
    background: #000000;
    color: #ffffff;
    border-bottom: 3px solid #ffffff;
}

body.high-contrast-mode .contact-card {
    border: 3px solid #000000;
    box-shadow: none;
    background: #ffffff;
}

body.high-contrast-mode .form-control,
body.high-contrast-mode .form-select {
    border: 2px solid #000000 !important;
    color: #000000 !important;
    background: #ffffff !important;
    font-weight: 700 !important;
}

body.high-contrast-mode .form-floating label {
    color: #000000 !important;
    font-weight: 800 !important;
}

body.high-contrast-mode .file-upload-area {
    border: 3px dashed #000000;
    background: #ffffff;
}

body.high-contrast-mode .file-upload-icon {
    color: #000000;
}

body.high-contrast-mode .contact-type-badge {
    background: #ffffff;
    border: 2px solid #000000;
    color: #000000;
    font-weight: 700;
}

    body.high-contrast-mode .contact-type-badge.active {
        background: #000000;
        color: #ffffff;
        border: 2px solid #000000;
        box-shadow: 0 0 0 2px #ffffff;
    }

body.high-contrast-mode .btn-primary {
    background: #000000 !important;
    border: 2px solid #000000 !important;
    color: #ffffff !important;
    font-weight: 800 !important;
}

    body.high-contrast-mode .btn-primary:hover {
        background: #333333 !important;
        text-decoration: underline !important;
    }

body.high-contrast-mode .contact-info-card {
    background: #ffffff !important;
    border: 2px solid #000000 !important;
    border-left: 5px solid #000000 !important;
}

    body.high-contrast-mode .contact-info-card a {
        color: #1642A2 !important;
        font-weight: 800 !important;
    }

body.high-contrast-mode .attachment-preview {
    border: 2px solid #000000;
    background: #ffffff;
}

body.high-contrast-mode .invalid-feedback {
    color: #8B0000 !important;
    font-weight: 800 !important;
}

body.high-contrast-mode .valid-feedback {
    color: #006400 !important;
    font-weight: 800 !important;
}

body.high-contrast-mode #contact-heading {
    color: white !important;
}

/* ========== RADIO BUTTONS COMO BADGES ACCESIBLES ========== */

.contact-type-options {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.contact-type-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.contact-type-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.875rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: 2px solid #cbd5e0;
    background-color: #ffffff;
    color: #1f2937;
    user-select: none;
    margin: 0;
    position: relative;
}

    .contact-type-badge:hover {
        transform: scale(1.05);
        border-color: #2563eb;
        background-color: #eff6ff;
    }

.contact-type-input:focus + .contact-type-badge {
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
    border-color: #2563eb;
    z-index: 10;
}

.contact-type-input:focus-visible + .contact-type-badge {
    outline: 3px solid #fbbf24;
    outline-offset: 2px;
}

.contact-type-input:checked + .contact-type-badge {
    background: linear-gradient(135deg, #2563eb 0%, #1e40af 100%);
    color: #ffffff;
    border-color: #1e40af;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

    .contact-type-input:checked + .contact-type-badge::before {
        content: "✓ ";
        font-weight: 700;
        font-size: 1rem;
    }

.contact-type-input:disabled + .contact-type-badge {
    opacity: 0.5;
    cursor: not-allowed;
    background-color: #f3f4f6;
    border-color: #d1d5db;
    transform: none;
}

    .contact-type-input:disabled + .contact-type-badge:hover {
        transform: none;
    }

body.high-contrast-mode .contact-type-badge {
    background: #ffffff;
    border: 2px solid #000000;
    color: #000000;
    font-weight: 700;
}

body.high-contrast-mode .contact-type-input:checked + .contact-type-badge {
    background: #000000 !important;
    color: #ffffff !important;
    border: 3px solid #000000 !important;
    box-shadow: 0 0 0 3px #ffffff !important;
}

body.high-contrast-mode .contact-type-input:focus + .contact-type-badge,
body.high-contrast-mode .contact-type-input:focus-visible + .contact-type-badge {
    outline: 4px solid #FFFF00 !important;
    outline-offset: 2px;
}

@media (max-width: 768px) {
    .contact-type-options {
        flex-direction: column;
        gap: 0.5rem;
    }

    .contact-type-badge {
        width: 100%;
        justify-content: center;
        padding: 1rem;
    }
}

/* Si usas file-input-hidden en lugar de d-none */
.file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}
