/* ============================================ */
/* FUENTES MONTSERRAT LOCALES (CSP Compliant)    */
/* ============================================ */
@font-face {
    font-family: 'Montserrat';
    src: url('/assets/fonts/Montserrat-ThinItalic.ttf') format('truetype');
    font-weight: 100;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('/assets/fonts/Montserrat-ExtraLight.ttf') format('truetype');
    font-weight: 200;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('/assets/fonts/Montserrat-Light.ttf') format('truetype');
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('/assets/fonts/Montserrat-Regular.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('/assets/fonts/Montserrat-Medium.ttf') format('truetype');
    font-weight: 500;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('/assets/fonts/Montserrat-MediumItalic.ttf') format('truetype');
    font-weight: 500;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('/assets/fonts/Montserrat-SemiBold.ttf') format('truetype');
    font-weight: 600;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('/assets/fonts/Montserrat-SemiBoldItalic.ttf') format('truetype');
    font-weight: 600;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('/assets/fonts/Montserrat-Bold.ttf') format('truetype');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('/assets/fonts/Montserrat-BoldItalic.ttf') format('truetype');
    font-weight: 700;
    font-style: italic;
    font-display: swap;
}
@font-face {
    font-family: 'Montserrat';
    src: url('/assets/fonts/Montserrat-Black.ttf') format('truetype');
    font-weight: 900;
    font-style: normal;
    font-display: swap;
}

/* ============================================ */
/* RESET - Pantalla completa                     */
/* ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: linear-gradient(135deg, #1a1030 0%, #2d1b4e 30%, #0d1b2a 100%);
    min-height: 100vh;
    font-family: 'Montserrat', sans-serif;
}

/* ============================================ */
/* WRAPPER Y HEADER                             */
/* ============================================ */
.agenda-wrapper {
    width: 100%;
    min-height: calc(100vh - 70px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 5% 25px 5%;
}

.agenda-header {
    text-align: center;
    margin-bottom: 30px;
}

.agenda-header h1 {
    font-size: 32px;
    font-weight: 700;
    background: linear-gradient(135deg, #c4a5ff 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.agenda-header .tagline {
    font-size: 16px;
    color: #c4a5ff;
    font-weight: 500;
    margin-bottom: 12px;
}

.agenda-header .horarios-info {
    font-size: 14px;
    color: #a78bfa;
    background: rgba(255,255,255,0.1);
    display: inline-block;
    padding: 6px 16px;
    border-radius: 40px;
    backdrop-filter: blur(4px);
}

/* ============================================ */
/* TARJETA DEL CALENDARIO                       */
/* ============================================ */
.agenda-container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.agenda-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(4px);
    border-radius: 32px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.agenda-card-header {
    background: linear-gradient(135deg, #4c1d95 0%, #1e1b4b 100%);
    padding: 20px 30px;
    color: white;
}

.agenda-card-header h2 {
    font-size: 22px;
    font-weight: 600;
    margin-bottom: 6px;
    margin-top: 0;
}

.agenda-card-header p {
    font-size: 14px;
    opacity: 0.9;
    margin: 0;
}

.agenda-card-body {
    padding: 30px;
}

/* ============================================ */
/* CALENDARIO NATIVO VANILLA JS                  */
/* ============================================ */
.cal-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
    padding: 0 4px;
}

.cal-nav-btn {
    background: #4c1d95;
    color: white;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Montserrat', sans-serif;
}

.cal-nav-btn:hover {
    background: #7c3aed;
    transform: scale(1.05);
}

.cal-titulo {
    color: #1f2937;
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.cal-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    text-align: center;
}

.cal-dia-header {
    padding: 10px 4px;
    font-size: 12px;
    font-weight: 700;
    color: #4c1d95;
    text-transform: uppercase;
    background: #f3e8ff;
    border-radius: 8px;
}

.cal-vacio {
    padding: 12px;
    border-radius: 8px;
    background: transparent;
}

.cal-dia {
    padding: 12px 4px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    background: #1a2332;
    color: #e0e0e0;
    position: relative;
}

.cal-dia:hover:not(.cal-disabled) {
    background: #7c3aed;
    color: white;
    transform: scale(1.05);
}

.cal-disponible {
    background: #064e3b;
    color: #d1fae5;
}

.cal-lleno {
    background: #7f1d1d;
    color: #fca5a5;
}

.cal-parcial {
    background: #78350f;
    color: #fcd34d;
}

.cal-parcial:hover:not(.cal-disabled) {
    background: #f59e0b;
    color: #000;
}

.cal-feriado {
    background: #fef3c7;
    color: #92400e;
}

.cal-feriado:hover:not(.cal-disabled) {
    background: #f59e0b;
    color: #000;
}

.cal-pasado {
    opacity: 0.3;
}

.cal-disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

.cal-hoy {
    border: 2px solid #f97316;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
}

.cal-hoy.cal-disponible {
    border-color: #10b981;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.cal-hoy.cal-parcial {
    border-color: #f59e0b;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.3);
}

.cal-hoy.cal-feriado {
    border-color: #d97706;
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.3);
}

/* ============================================ */
/* MODAL                                         */
/* ============================================ */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(29, 17, 51, 0.95);
    backdrop-filter: blur(8px);
    z-index: 10001;
    justify-content: center;
    align-items: center;
}

.modal-overlay.active {
    display: flex;
}

.modal-container {
    background: white;
    border-radius: 32px;
    max-width: 550px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: modalIn 0.3s ease-out;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.modal-header {
    background: linear-gradient(135deg, #4c1d95 0%, #1e1b4b 100%);
    color: white;
    padding: 24px;
    border-radius: 32px 32px 0 0;
}

.modal-header h3 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 4px;
    margin-top: 0;
}

.modal-header p {
    font-size: 13px;
    opacity: 0.9;
    margin: 0;
}

.modal-body {
    padding: 24px;
}

.modal-footer {
    padding: 16px 24px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 12px;
}

/* ============================================ */
/* FORMULARIOS                                   */
/* ============================================ */
.form-preview {
    background: #f8f9fa;
    border-radius: 16px;
    padding: 16px;
    margin-bottom: 20px;
    font-size: 14px;
}

.form-preview-row {
    display: flex;
    margin-bottom: 8px;
}

.form-preview-label {
    width: 100px;
    color: #6b7280;
    font-weight: 500;
}

.form-preview-value {
    color: #1f2937;
    font-weight: 500;
}

.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-size: 14px;
    font-family: 'Montserrat', sans-serif;
    transition: all 0.2s;
    background: white;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #7c3aed;
}

/* ============================================ */
/* HORARIOS Y MODALIDAD                          */
/* ============================================ */
.horario-opciones {
    display: flex;
    gap: 12px;
    margin: 15px 0;
}

.horario-btn {
    flex: 1;
    padding: 14px;
    border: 2px solid #e5e7eb;
    border-radius: 16px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.horario-btn:hover:not(.disabled) {
    border-color: #7c3aed;
    transform: translateY(-2px);
}

.horario-btn.selected {
    border-color: #7c3aed;
    background: #ede9fe;
}

.horario-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.horario-hora {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
}

.horario-tipo {
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

.modalidad-options {
    display: flex;
    gap: 12px;
    margin-top: 10px;
}

.modalidad-option {
    flex: 1;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
}

.modalidad-option:hover {
    border-color: #7c3aed;
}

.modalidad-option.selected {
    border-color: #7c3aed;
    background: #ede9fe;
}

.modalidad-selector {
    margin-top: 15px;
}

/* ============================================ */
/* BOTONES                                       */
/* ============================================ */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #4c1d95 0%, #1e1b4b 100%);
    color: white;
    border: none;
    padding: 14px;
    border-radius: 40px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(76, 29, 149, 0.3);
}

.btn-hidden {
    display: none !important;
}

.btn-secondary {
    background: #f3f4f6;
    color: #374151;
    border: none;
    padding: 12px 20px;
    border-radius: 40px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    flex: 1;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: #e5e7eb;
}

/* ============================================ */
/* MENSAJES                                      */
/* ============================================ */
.info-disponibilidad {
    background: #ede9fe;
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #4c1d95;
    border-left: 3px solid #7c3aed;
}

.error-message {
    background: #fef2f2;
    border: 1px solid #fee2e2;
    border-radius: 12px;
    padding: 14px;
    color: #dc2626;
    font-size: 13px;
    margin-bottom: 20px;
}

.loading-message {
    text-align: center;
    padding: 20px;
}

.cupo-parcial { color: #f59e0b; }
.cupo-disponible { color: #10b981; }
.cupo-lleno { color: #ef4444; }

/* ============================================ */
/* GRUPO DE TELÉFONO                             */
/* ============================================ */
.telefono-group {
    display: flex;
    gap: 8px;
}

.codigo-input {
    width: 90px !important;
    background: #f3f4f6 !important;
    color: #6b7280 !important;
    text-align: center;
    font-weight: 600;
    flex-shrink: 0;
}

.telefono-group input[type="tel"] {
    flex: 1;
}

.form-hint {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    display: block;
}

/* ============================================ */
/* CONFIRMACIÓN PENDIENTE                        */
/* ============================================ */
.pending-confirmation {
    margin-top: 25px;
    margin-bottom: 25px;
    padding: 20px 25px;
    background: linear-gradient(135deg, #fef3c7 0%, #fffbeb 100%);
    border-left: 5px solid #f59e0b;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
    display: none;
}

.pending-confirmation .pending-content {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.pending-confirmation .pending-icon {
    font-size: 40px;
    background: rgba(245, 158, 11, 0.125);
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.pending-confirmation .pending-message { flex: 1; }
.pending-confirmation .pending-message strong { color: #92400e; font-size: 16px; display: block; margin-bottom: 4px; }
.pending-confirmation .pending-message p { color: #78350f; margin: 0; font-size: 14px; line-height: 1.5; }
.pending-confirmation .pending-buttons { display: flex; gap: 12px; }

.pending-confirmation .btn-pending {
    background: #7c3aed;
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 12px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    font-family: 'Montserrat', sans-serif;
}

.pending-confirmation .btn-pending:hover { background: #6d28d9; transform: translateY(-2px); }
.pending-confirmation .btn-resend { background: #4b5563; }
.pending-confirmation .btn-resend:hover { background: #374151; }
.pending-confirmation .pending-footer { color: #78350f; font-size: 13px; margin-top: 15px; padding-top: 12px; border-top: 1px solid #fde68a; }

/* ============================================ */
/* MODAL DE NOTIFICACIONES                       */
/* ============================================ */
.modal-notificacion-container {
    max-width: 450px;
}

.modal-notificacion-header.success { background: linear-gradient(135deg, #059669, #047857); }
.modal-notificacion-header.error { background: linear-gradient(135deg, #dc2626, #b91c1c); }
.modal-notificacion-header.warning { background: linear-gradient(135deg, #d97706, #b45309); }
.modal-notificacion-header.info { background: linear-gradient(135deg, #4c1d95, #1e1b4b); }

.notificacion-icono { font-size: 48px; text-align: center; margin: 16px 0; }
.notificacion-mensaje { text-align: center; color: #1f2937; font-size: 14px; line-height: 1.6; padding: 0 16px; }
.notificacion-email-destacado { margin: 12px 0; font-size: 16px; }
.notificacion-expiracion { color: #6b7280; font-size: 12px; margin-top: 8px; }

.codigo-verificacion-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    text-align: center;
    font-size: 20px;
    letter-spacing: 4px;
    font-family: 'Montserrat', sans-serif;
}

.codigo-verificacion-input:focus { outline: none; border-color: #7c3aed; }
.input-error { border-color: #dc2626 !important; }
.error-text { color: #dc2626; font-size: 12px; margin-top: 4px; text-align: center; }

/* ============================================ */
/* MODAL DE CARGA                                */
/* ============================================ */
.modal-carga-content { text-align: center; color: white; }
.modal-carga-content p { margin-top: 16px; font-size: 16px; }

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto;
}

/* ============================================ */
/* TURNSTILE WIDGET                              */
/* ============================================ */
.turnstile-widget {
    margin: 15px 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================ */
/* RESPONSIVE                                    */
/* ============================================ */
@media (max-width: 640px) {
    .agenda-header h1 { font-size: 24px; }
    .agenda-card-body { padding: 15px; }
    .horario-opciones { flex-direction: column; }
    .modalidad-options { flex-direction: column; }
    .modal-container { width: 95%; border-radius: 24px; }
    .pending-confirmation .pending-content { flex-direction: column; text-align: center; }
    .pending-confirmation .pending-buttons { width: 100%; justify-content: center; }
    .pending-confirmation .btn-pending { flex: 1; text-align: center; }
    .form-preview-row { flex-direction: column; }
    .form-preview-label { width: 100%; margin-bottom: 2px; }
}

@media (max-width: 480px) {
    .agenda-card-header { padding: 15px 20px; }
    .agenda-card-header h2 { font-size: 18px; }
    .cal-dia { padding: 10px 2px; font-size: 12px; }
    .cal-titulo { font-size: 16px; }
    .btn-pending { width: 100%; }
}

@media (min-width: 768px) {
    .cal-dia {
        padding: 18px 8px;
        font-size: 16px;
    }
    .cal-dia-header {
        padding: 14px 8px;
        font-size: 13px;
    }
    .cal-grid {
        gap: 6px;
    }
    .cal-titulo {
        font-size: 22px;
    }
}