/* agendar-cita.css */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&family=Orbitron:wght@500;700&display=swap');

:root {
    --color-purple: #5228EC;
    --color-purple-rgb: 82, 40, 236; /* Para usar en rgba */
    --color-blue: #03B2FD;
    --color-dark-blue: #027ead; 
    --color-black: #2c2f33; 
    --color-dark-purple: #3e1ead;
    --color-orange: #FF470B;
    --color-white: #FFFFFF;
    --color-light-gray-bg: #f4f6f9; 
    --color-medium-gray: #e9ecef; 
    --color-dark-gray-text: #5a6268; 
    --color-text-on-purple: #FFFFFF;
    --color-text-on-purple-muted: rgba(255, 255, 255, 0.85);
    --color-input-bg-on-purple: rgba(255, 255, 255, 0.08);
    --color-input-border-on-purple: rgba(3, 178, 253, 0.4);
    --color-input-focus-border-on-purple: var(--color-blue);

    --font-primary: 'Poppins', sans-serif;
    --font-headings: 'Orbitron', sans-serif;
    
    --border-radius-sm: 6px;
    --border-radius-md: 10px;
    --border-radius-lg: 15px;

    --shadow-soft: 0 4px 15px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 25px rgba(0, 0, 0, 0.1);
    --shadow-purple-accent: 0 10px 30px rgba(var(--color-purple-rgb), 0.2);
}

/* --- Estilos Base --- */
body {
    font-family: var(--font-primary);
    background-color: var(--color-light-gray-bg);
    color: var(--color-black);
    margin: 0;
    padding: 0;
    line-height: 1.65;
    overflow-x: hidden;
}

.page-wrapper {
    transition: filter 0.3s ease-in-out;
}

.page-wrapper.blurred {
    filter: blur(8px) brightness(0.7);
    pointer-events: none; 
}

/* --- Navbar --- */
.main-navbar {
    background-color: var(--color-white);
    padding: 15px 0;
    box-shadow: var(--shadow-soft);
    position: sticky; 
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000; 
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar-brand {
    font-family: var(--font-headings);
    color: var(--color-purple);
    font-size: 1.8rem;
    font-weight: 700;
    text-decoration: none;
    display: flex;
    align-items: center;
}
.navbar-brand i {
    margin-right: 8px;
    animation: spinAtom 8s linear infinite;
}
@keyframes spinAtom {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.navbar-links {
    display: flex;
    align-items: center;
}
.navbar-links a {
    color: var(--color-dark-gray-text);
    text-decoration: none;
    margin-left: 25px;
    font-weight: 500;
    transition: color 0.3s ease;
}
.navbar-links a:hover {
    color: var(--color-purple);
}
.navbar-links .btn-login-nav {
    background-color: var(--color-purple);
    color: var(--color-white);
    padding: 8px 18px;
    border-radius: var(--border-radius-sm);
    transition: background-color 0.3s ease, transform 0.2s ease;
}
.navbar-links .btn-login-nav:hover {
    background-color: var(--color-dark-purple);
    color: var(--color-white);
    transform: translateY(-2px);
}

.navbar-toggler {
    display: none; 
    background: none;
    border: none;
    font-size: 1.8rem;
    color: var(--color-purple);
    cursor: pointer;
}

/* --- Enlace Pre-Encabezado --- */
.pre-header-notice {
    text-align: center;
    padding: 15px 20px;
    background-color: rgba(var(--color-purple-rgb), 0.05); 
    margin-top: 20px; /* Espacio desde el navbar si es sticky */
    margin-bottom: 25px; 
    border-radius: var(--border-radius-sm);
    border: 1px solid rgba(var(--color-purple-rgb), 0.1);
}
.pre-header-notice a {
    color: var(--color-purple);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease, text-decoration 0.3s ease;
}
.pre-header-notice a:hover {
    color: var(--color-dark-purple);
    text-decoration: underline;
}
.pre-header-notice a i {
    margin-right: 8px;
    color: var(--color-blue);
}

/* --- Contenido Principal y Encabezado de Página --- */
.main-content {
    max-width: 850px; 
    margin: 0 auto 40px auto; /* Ajustado para que pre-header-notice se vea bien */
    padding: 0 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 40px;
}
.page-header h1 {
    font-family: var(--font-headings);
    color: var(--color-purple);
    font-size: 2.8rem;
    font-weight: 700;
}

/* --- Estructura de Pasos Visuales --- */
.page-steps-container {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 50px;
    padding: 0 10px;
}
.page-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    width: 100px;
    opacity: 0.5;
    transition: opacity 0.3s ease, transform 0.3s ease;
}
.page-step.active {
    opacity: 1;
    transform: scale(1.05);
}
.page-step.completed {
    opacity: 0.8;
}
.page-step.completed .page-step-icon {
    background-color: var(--color-blue); 
    border-color: var(--color-blue);
    color: var(--color-white);
}
.page-step.completed .page-step-icon i {
    animation: bounceIcon 0.5s ease;
}
@keyframes bounceIcon {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-5px); }
}

.page-step-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--color-medium-gray);
    color: var(--color-dark-gray-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 10px;
    border: 3px solid var(--color-medium-gray);
    transition: all 0.3s ease;
}
.page-step.active .page-step-icon {
    background-color: var(--color-purple);
    border-color: var(--color-purple);
    color: var(--color-white);
    box-shadow: 0 0 15px rgba(var(--color-purple-rgb), 0.4);
}
.page-step-label {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-dark-gray-text);
}
.page-step.active .page-step-label {
    color: var(--color-purple);
}
.page-step-connector {
    flex-grow: 1;
    height: 4px;
    background-color: var(--color-medium-gray);
    margin: 28px 5px 0 5px; 
    border-radius: 2px;
    transition: background-color 0.3s ease;
}
.page-step.completed + .page-step-connector {
    background-color: var(--color-blue);
}

/* --- Modal --- */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(26, 29, 36, 0.7); /* Ligeramente más oscuro el overlay */
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000; 
    opacity: 1;
    transition: opacity 0.3s ease-in-out;
    padding: 20px;
}
.modal-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background-color: var(--color-white);
    padding: 35px 40px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-medium);
    text-align: center;
    max-width: 550px;
    width: 100%;
    animation: slideInModal 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    z-index: 2001; 
}
@keyframes slideInModal {
    from { transform: translateY(-30px) scale(0.95); opacity: 0; }
    to { transform: translateY(0) scale(1); opacity: 1; }
}

.modal-title {
    font-family: var(--font-headings);
    color: var(--color-purple);
    font-size: 1.8rem;
    margin-bottom: 15px;
}
.modal-title i { margin-right: 10px; }
.modal-text {
    color: var(--color-black);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 15px;
}
.modal-question {
    font-weight: 600;
    color: var(--color-purple);
    font-size: 1.1rem;
    margin-bottom: 25px;
}
.modal-button {
    background: linear-gradient(135deg, var(--color-purple), var(--color-blue));
    color: var(--color-white);
    font-weight: 600;
    letter-spacing: 0.5px;
    padding: 12px 30px;
    border: none;
    border-radius: var(--border-radius-sm);
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(var(--color-purple-rgb), 0.2);
}
.modal-button:hover {
    background: linear-gradient(135deg, var(--color-dark-purple), var(--color-dark-blue));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--color-purple-rgb), 0.3);
}
.modal-button i { margin-left: 8px; }


/* --- Formulario de Sondeo --- */
.survey-form-container {
    background-color: var(--color-purple); 
    padding: 35px 45px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-purple-accent);
    margin-top: 30px;
    opacity: 0; 
    transform: translateY(20px);
    pointer-events: none; 
    transition: opacity 0.5s ease-out, transform 0.5s ease-out;
}
.survey-form-container.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
.survey-form-container.hidden { /* Para ocultar completamente después de la animación si se desea */
     display: none; 
}

.form-group { margin-bottom: 28px; }
.form-group label.main-label {
    display: block; font-weight: 600; color: var(--color-white);
    margin-bottom: 12px; font-size: 1.05rem;
}
.form-group input[type="text"], .form-group textarea {
    width: 100%; padding: 14px 18px;
    background-color: var(--color-input-bg-on-purple);
    border: 1px solid var(--color-input-border-on-purple);
    border-radius: var(--border-radius-sm); color: var(--color-white);
    font-size: 0.95rem; box-sizing: border-box;
    transition: border-color 0.3s ease, box-shadow 0.3s ease, background-color 0.3s ease;
}
.form-group input[type="text"]::placeholder, .form-group textarea::placeholder {
    color: rgba(255, 255, 255, 0.6);
}
.form-group input[type="text"]:focus, .form-group textarea:focus {
    background-color: rgba(255, 255, 255, 0.15);
    border-color: var(--color-input-focus-border-on-purple);
    box-shadow: 0 0 12px rgba(var(--color-blue-rgb, 3, 178, 253), 0.4); /* Define --color-blue-rgb si es necesario */
    outline: none;
}
.form-group textarea { min-height: 100px; resize: vertical; }

.radio-group label, .checkbox-group label {
    display: flex; align-items: center; color: var(--color-text-on-purple-muted);
    margin-bottom: 10px; font-size: 0.95rem; font-weight: 400; cursor: pointer;
    padding: 8px 12px; border-radius: var(--border-radius-sm); transition: background-color 0.2s ease;
}
.radio-group label:hover, .checkbox-group label:hover {
    background-color: rgba(255, 255, 255, 0.05);
}
.radio-group input[type="radio"], .checkbox-group input[type="checkbox"] {
    margin-right: 10px; flex-shrink: 0; accent-color: var(--color-blue);
    width: 18px; height: 18px;
}
.input-other { margin-top: 8px; padding-left: 28px; }
.input-other input[type="text"] { font-size: 0.9rem; padding: 10px 15px; }

.btn-submit-survey {
    display: block; width: 100%;
    background: linear-gradient(135deg, var(--color-orange), #ff6a3b);
    color: white; font-weight: 700; letter-spacing: 0.8px;
    padding: 16px 25px; border: none; border-radius: var(--border-radius-sm);
    font-size: 1.1rem; cursor: pointer;
    transition: background 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 71, 11, 0.3); margin-top: 30px;
    text-transform: uppercase;
}
.btn-submit-survey:hover {
    background: linear-gradient(135deg, #e03e0a, #ff521f);
    transform: translateY(-3px); box-shadow: 0 8px 25px rgba(255, 71, 11, 0.4);
}

/* --- Estilos para Acciones Post-Envío --- */
.post-survey-actions {
    margin-top: 40px;
    padding: 0px; /* Ajustado para que los hijos controlen el padding si es necesario */
    text-align: center;
    opacity: 0; 
    transform: translateY(20px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}
.post-survey-actions.visible {
    opacity: 1;
    transform: translateY(0);
}

.thank-you-message { 
    background-color: var(--color-blue); 
    color: var(--color-white);
    padding: 35px 30px;
    border-radius: var(--border-radius-md);
    margin-bottom: 35px;
    box-shadow: var(--shadow-soft);
}
.thank-you-message h2 {
    font-family: var(--font-headings);
    color: var(--color-white); 
    margin-bottom: 15px; 
    font-size: 1.8rem;
}
.thank-you-message h2 i {
    margin-right: 12px;
    color: #c8e6c9; /* Un verde más claro y sutil para el check */
}
.thank-you-message p {
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 25px; 
}

.thank-you-continue-btn {
    /* Usamos estilos de .modal-button, podemos añadir o sobreescribir aquí */
    background: linear-gradient(135deg, var(--color-purple), var(--color-dark-purple)) !important; /* Botón más distintivo */
    padding: 10px 25px !important;
    font-size: 1rem !important;
    display: inline-block; 
    margin-top: 10px; 
}
.thank-you-continue-btn:hover {
    background: linear-gradient(135deg, var(--color-dark-purple), var(--color-purple)) !important; 
    box-shadow: 0 6px 20px rgba(var(--color-purple-rgb), 0.4);
}
.thank-you-continue-btn i {
    margin-left: 8px;
    transition: transform 0.2s ease-in-out;
}
.thank-you-continue-btn:hover i {
    transform: translateY(2px);
}

.next-steps-section {
    background-color: var(--color-white);
    padding: 40px 35px;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-medium);
    border-top: 5px solid var(--color-purple);
    margin-top: 0; /* Ya tiene margen el .thank-you-message */
}
.next-steps-section h3 {
    font-family: var(--font-headings);
    color: var(--color-purple);
    font-size: 1.9rem; /* Un poco más grande */
    margin-bottom: 25px;
}
.next-steps-section h3 i {
    margin-right: 12px;
}
.next-steps-section p {
    font-size: 1.05rem; /* Un poco más grande */
    color: var(--color-dark-gray-text);
    line-height: 1.75;
    margin-bottom: 25px;
}
.next-steps-section .btn-cta-main {
    display: inline-block;
    background: linear-gradient(135deg, var(--color-orange), #ff6a3b);
    color: var(--color-white);
    font-weight: 700;
    letter-spacing: 0.8px; /* Más espaciado */
    padding: 16px 35px; /* Más padding */
    border-radius: var(--border-radius-sm);
    text-decoration: none;
    font-size: 1.15rem; /* Más grande */
    transition: all 0.3s ease;
    box-shadow: 0 5px 20px rgba(255, 71, 11, 0.3);
    margin-top: 15px;
    margin-bottom: 25px;
    text-transform: uppercase;
}
.next-steps-section .btn-cta-main:hover {
    background: linear-gradient(135deg, #e03e0a, #ff521f);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(255, 71, 11, 0.4);
}
.next-steps-section .btn-cta-main i {
    margin-left: 10px;
}
.next-steps-section .alternative-contact {
    font-size: 0.95rem;
    color: var(--color-dark-gray-text);
}
.next-steps-section .contact-link {
    color: var(--color-purple);
    font-weight: 600;
    text-decoration: none; /* Quitar subrayado por defecto, añadir en hover */
    border-bottom: 2px dotted var(--color-purple); /* Subrayado punteado */
    transition: color 0.2s, border-bottom-color 0.2s;
}
.next-steps-section .contact-link:hover {
    color: var(--color-dark-purple);
    border-bottom-color: var(--color-dark-purple);
}

/* --- Utilidades --- */
.hidden { display: none !important; }


/* --- Responsive Navbar y Contenido --- */
@media (max-width: 768px) {
    .navbar-links {
        display: none; 
        flex-direction: column;
        width: 100%;
        background-color: var(--color-white);
        position: absolute;
        top: 68px; 
        left: 0;
        box-shadow: var(--shadow-soft);
        padding-bottom: 10px;
    }
    .navbar-links.active {
        display: flex; 
    }
    .navbar-links a {
        margin: 10px 0;
        padding: 10px 20px;
        width: 100%;
        text-align: center;
    }
    .navbar-links .btn-login-nav {
        margin-left: 0;
        margin: 10px 20px;
    }
    .navbar-toggler {
        display: block; 
    }

    .page-header h1 { font-size: 2.2rem; }
    .page-steps-container { flex-direction: column; align-items: center; gap: 15px; }
    .page-step { width: auto; flex-direction: row; align-items: center; }
    .page-step-icon { margin-right: 10px; margin-bottom: 0; width: 45px; height: 45px; font-size: 1.5rem;}
    .page-step-label { font-size: 0.85rem; }
    .page-step-connector { display: none; }

    .survey-form-container { padding: 25px 20px; }
    .modal-content { padding: 25px; margin: 0 10px;}
    .modal-title { font-size: 1.5rem; }
    .modal-text { font-size: 0.95rem; }

    .thank-you-message { padding: 25px 20px; }
    .thank-you-message h2 { font-size: 1.6rem; }
    .thank-you-message p { font-size: 1rem; }
    .thank-you-continue-btn { padding: 10px 20px !important; font-size: 0.9rem !important; }

    .next-steps-section { padding: 30px 25px; }
    .next-steps-section h3 { font-size: 1.5rem; }
    .next-steps-section p { font-size: 0.95rem; }
    .next-steps-section .btn-cta-main { padding: 12px 25px; font-size: 1rem; }

    .pre-header-notice { margin-top: 15px; margin-bottom: 20px; padding: 12px 15px;}
    .pre-header-notice a { font-size: 0.85rem; }
}

@media (max-width: 480px) {
    .main-content { margin: 0 auto 20px auto; padding: 0 15px;}
    .page-header h1 { font-size: 1.9rem; }
    .survey-form-container { padding: 20px 15px; }
    .form-group label.main-label { font-size: 1rem; }
    .form-group input[type="text"], .form-group textarea { padding: 12px 15px; font-size: 0.9rem; }
    .btn-submit-survey { font-size: 1rem; padding: 14px 20px; }

    .modal-content { padding: 20px; }
    .modal-title { font-size: 1.4rem; }

    .thank-you-message { padding: 20px; }
    .next-steps-section { padding: 25px 20px; }
    .next-steps-section .btn-cta-main { width: 100%; } /* Botón CTA ocupa todo el ancho */
}

/* agendar-cita.css */
/* ... (tus estilos existentes) ... */

/* --- Estilos para Ayudas y Errores del Formulario --- */
.form-group {
    position: relative; /* Para posicionar mensajes de error si es necesario */
    /* margin-bottom ya está definido, pero asegúrate de que haya espacio para los mensajes */
}

.helper-text {
    display: block;
    font-size: 0.8rem;
    color: var(--color-text-on-purple-muted); /* Un color sutil */
    margin-top: 5px;
    font-style: italic;
}

.error-message,
.error-message-radio,
.error-message-checkbox {
    display: none; /* Oculto por defecto */
    color: #ffbaba;  /* Un rojo claro para errores sobre fondo oscuro */
    background-color: rgba(255, 0, 0, 0.2); /* Fondo sutil para el error */
    padding: 6px 10px;
    border-radius: var(--border-radius-sm);
    font-size: 0.85rem;
    margin-top: 6px;
    border-left: 3px solid #f44336; /* Borde rojo para destacar */
}

input.invalid,
textarea.invalid,
select.invalid + .select2-container .select2-selection--single { /* Para Select2 */
    border-color: #f44336 !important; /* Borde rojo para campos inválidos */
    background-color: rgba(255, 0, 0, 0.1) !important; /* Fondo ligeramente rojo */
}
/* Para Select2 cuando es inválido */
.select2-container.invalid-select2 .select2-selection--single {
    border-color: #f44336 !important;
    background-color: rgba(255, 0, 0, 0.1) !important;
}


.radio-group label.invalid-radio, /* Si quieres marcar el label del radio individual */
.checkbox-group label.invalid-checkbox {
    /* Puedes añadir un estilo aquí, aunque el error-message-radio/checkbox es más general */
}

/* Ajustes para Select2 (los estilos básicos ya están en el <style> del HTML por carga de CDN) */
/* Puedes refinar más aquí si es necesario */
.select2-container .select2-search--inline .select2-search__field { /* Para búsqueda en multiselect si lo usaras */
    color: var(--color-white) !important;
}