/**
 * Estilos CSS profesionales para el plugin Auto Agendamiento Clase B
 * 
 * @package AutoAgendamientoClaseB
 * @since 1.0.0
 */

/* Variables CSS */
:root {
    --primary-color: #ffd500;
    --primary-hover: #e6c000;
    --primary-light: #fffbeb;
    --success-color: #10b981;
    --success-light: #d1fae5;
    --error-color: #ef4444;
    --error-light: #fee2e2;
    --warning-color: #f59e0b;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;
    --border-color: #e5e7eb;
    --border-focus: #ffd500;
    --bg-white: #ffffff;
    --bg-light: #f9fafb;
    --bg-gray: #f3f4f6;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

/* Contenedor principal */
.auto-agendamiento-container {
    max-width: 720px;
    margin: 60px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    box-sizing: border-box;
    width: 100%;
}

/* Título principal */
.form-title {
    text-align: center;
    color: var(--text-primary);
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -0.025em;
    line-height: 1.2;
    margin-bottom: 48px;
}

/* Indicador de progreso */
.progress-indicator {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 32px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    width: 100%;
    overflow: hidden;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    max-width: 500px;
    margin: 0 auto;
    width: 100%;
    gap: 0;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: var(--border-color);
    z-index: 1;
}

@media (max-width: 400px) {
    .progress-indicator {
        padding: 8px 1px;
    }
    
    .progress-steps {
        padding: 0;
        justify-content: space-between;
        gap: 0;
    }
    
    .progress-steps::before {
        left: 16px;
        right: 16px;
        top: 10px;
        height: 1.5px;
    }
    
    .step {
        padding: 0;
        gap: 2px;
        flex: 0 1 14%;
        max-width: 14%;
    }
    
    .step-number {
        width: 20px;
        height: 20px;
        font-size: 8px;
    }
    
    .step-label {
        font-size: 5.5px;
        letter-spacing: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1;
    }
}

@media (max-width: 360px) {
    .auto-agendamiento-container {
        padding: 0 6px;
    }
    
    .progress-indicator {
        padding: 8px 0;
        margin-left: -3px;
        margin-right: -3px;
        border-radius: var(--radius-lg);
    }
    
    .progress-steps {
        padding: 0;
        margin: 0;
        gap: 0;
    }
    
    .progress-steps::before {
        left: 12px;
        right: 12px;
        top: 9px;
        height: 1.5px;
    }
    
    .step {
        padding: 0;
        gap: 1px;
        max-width: 13%;
        flex: 0 1 13%;
    }
    
    .step-number {
        width: 18px;
        height: 18px;
        font-size: 7px;
    }
    
    .step-label {
        font-size: 5px;
        letter-spacing: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        line-height: 1;
        display: none; /* Ocultar etiquetas en pantallas muy pequeñas */
    }
}

@media (max-width: 320px) {
    .auto-agendamiento-container {
        padding: 0 2px;
    }
    
    .progress-indicator {
        padding: 6px 0;
        margin-left: -1px;
        margin-right: -1px;
    }
    
    .progress-steps {
        gap: 0;
    }
    
    .progress-steps::before {
        left: 10px;
        right: 10px;
        top: 8px;
        height: 1px;
    }
    
    .step {
        gap: 0;
        max-width: 12%;
        flex: 0 1 12%;
    }
    
    .step-number {
        width: 16px;
        height: 16px;
        font-size: 6px;
    }
    
    .step-label {
        display: none; /* Ocultar completamente las etiquetas */
    }
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    position: relative;
    z-index: 2;
    background: var(--bg-white);
    padding: 0 12px;
    flex-shrink: 1;
    min-width: 0;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--bg-gray);
    color: var(--text-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
    border: 2px solid transparent;
}

.step-label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    transition: var(--transition);
}

.step.active .step-number {
    background: var(--primary-color);
    color: #1a1a1a;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

.step.active .step-label {
    color: #1a1a1a;
    font-weight: 600;
}

.step.completed .step-number {
    background: var(--primary-color);
    color: #1a1a1a;
    border-color: var(--primary-color);
}

.step.completed .step-label {
    color: #1a1a1a;
}

/* Formulario */
.auto-agendamiento-form {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    overflow: hidden;
}

/* Secciones del formulario */
.form-section {
    padding: 40px;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.form-section h3::before {
    content: '';
    width: 4px;
    height: 24px;
    background: var(--primary-color);
    border-radius: 2px;
}

/* Grupos de formulario */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-group:last-child {
    margin-bottom: 0;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 8px;
}

/* Inputs */
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    transition: var(--transition);
    outline: none;
}

.form-group input::placeholder {
    color: var(--text-light);
}

.form-group input:hover,
.form-group select:hover {
    border-color: var(--text-secondary);
}

.form-group input:focus,
.form-group select:focus {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px var(--primary-light);
}

/* Select personalizado */
.form-group select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 20px;
    padding-right: 40px;
    cursor: pointer;
}

/* Phone input group */
.phone-input-group {
    display: flex;
    gap: 8px;
}

.phone-prefix {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-gray);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    white-space: nowrap;
}

.phone-input-group input {
    flex: 1;
}

/* Checkbox personalizado */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 16px;
    background: var(--bg-light);
    border-radius: var(--radius-md);
    border: 2px solid transparent;
    transition: var(--transition);
}

.checkbox-label:hover {
    background: var(--primary-light);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    appearance: none;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
    flex-shrink: 0;
}

.checkbox-label input[type="checkbox"]:checked {
    background: var(--primary-color);
    border-color: var(--primary-color);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-label span {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Información del comprador */
.comprador-info {
    margin-top: 24px;
    padding-top: 24px;
    border-top: 2px dashed var(--border-color);
    animation: slideDown 0.3s ease-out;
}

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

/* Contenedor de precio */
.precio-container {
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-white) 100%);
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    margin-top: 48px;
    margin-bottom: 24px;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.precio-display {
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 8px;
}

.precio-simbolo {
    font-size: 48px;
    font-weight: 700;
    color: #000000;
}

.precio-valor {
    font-size: 48px;
    font-weight: 700;
    color: #000000;
    line-height: 1;
}

.precio-nota-variacion {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
    display: flex !important;
    justify-content: center;
    align-items: center;
    width: 100%;
    opacity: 1;
    visibility: visible;
    text-align: center;
}

.precio-asterisco {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-right: 3px;
    vertical-align: middle;
    opacity: 0.7;
    display: inline;
}

.precio-nota-texto {
    font-size: 12px;
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
    font-weight: 400;
    letter-spacing: 0.01em;
    opacity: 0.7;
    display: inline;
    font-style: normal;
    display: inline;
}

/* Loading de sedes */
.loading-sedes {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 8px;
    font-style: italic;
}

.loading-sedes::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid var(--border-color);
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Acciones del formulario */
.form-actions {
    padding: 32px 40px;
    background: var(--bg-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.form-actions.single-button {
    justify-content: center;
}

/* Botón principal */
.btn-primary.btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 200px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    background: var(--primary-color);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-md);
    text-transform: none;
    letter-spacing: 0;
}

/* Botón secundario (Volver) */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 150px;
    padding: 16px 32px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-white);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
    text-transform: none;
    letter-spacing: 0;
}

.btn-primary.btn-submit:hover:not(:disabled) {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-primary.btn-submit:active:not(:disabled) {
    transform: translateY(0);
}

.btn-primary.btn-submit:disabled {
    background: var(--bg-gray);
    color: var(--text-light);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-light);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary:active:not(:disabled) {
    transform: translateY(0);
}

.btn-secondary:disabled {
    background: var(--bg-gray);
    color: var(--text-light);
    border-color: var(--border-color);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

.btn-loading {
    display: none;
}

.btn-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid rgba(26, 26, 26, 0.3);
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

/* Mensajes del formulario */
.form-messages {
    margin-top: 24px;
}

.message {
    padding: 16px 20px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    line-height: 1.5;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    animation: slideIn 0.3s ease-out;
}

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

.message::before {
    content: '';
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 50%;
}

.message-error {
    background: var(--error-light);
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.message-error::before {
    background: var(--error-color);
}

.message-success {
    background: var(--success-light);
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.message-success::before {
    background: var(--success-color);
}

.message-info {
    background: var(--primary-light);
    color: #92400e;
    border: 1px solid #fde68a;
}

.message-info::before {
    background: var(--primary-color);
}

.message-warning {
    background: #fff7ed;
    color: #9a3412;
    border: 1px solid #fed7aa;
}

.message-warning::before {
    background: var(--warning-color);
}

/* Estados de validación */
.form-group input.error,
.form-group select.error {
    border-color: var(--error-color);
    background: var(--error-light);
}

.form-group input.error:focus,
.form-group select.error:focus {
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.form-group input.valid,
.form-group select.valid {
    border-color: var(--success-color);
    background: var(--success-light);
}

.form-group input.valid:focus,
.form-group select.valid:focus {
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

/* Indicadores de validación */
.form-group input.error,
.form-group input.valid {
    padding-right: 44px;
}

.form-group input.error::after,
.form-group input.valid::after {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
    font-weight: bold;
}

/* Mensajes de error de campo */
.field-error {
    display: block;
    color: var(--error-color);
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
}

.field-success {
    display: block;
    color: var(--success-color);
    font-size: 13px;
    margin-top: 6px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .auto-agendamiento-container {
        margin: 30px auto;
        padding: 0 12px;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    .form-title {
        font-size: 28px;
        margin-bottom: 32px;
    }
    
    .progress-indicator {
        padding: 12px 4px;
        overflow-x: hidden;
        overflow-y: visible;
    }
    
    .progress-steps {
        max-width: 100%;
        width: 100%;
        padding: 0;
        justify-content: space-between;
        gap: 0;
    }
    
    .progress-steps::before {
        left: 24px;
        right: 24px;
        top: 14px;
    }
    
    .step {
        padding: 0;
        flex: 0 1 18%;
        min-width: 0;
        max-width: 18%;
    }
    
    .step-number {
        width: 26px;
        height: 26px;
        font-size: 10px;
    }
    
    .step-label {
        font-size: 7px;
        line-height: 1;
        text-align: center;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
        display: block;
    }
    
    .form-section {
        padding: 32px 24px;
    }
    
    .form-section h3 {
        font-size: 18px;
        margin-bottom: 20px;
    }
    
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input,
    .form-group select {
        padding: 12px 14px;
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .phone-input-group {
        gap: 6px;
    }
    
    .phone-prefix {
        padding: 12px 14px;
        font-size: 14px;
    }
    
    .precio-container {
        padding: 24px;
        margin-top: 24px;
    }
    
    .precio-valor {
        font-size: 40px;
    }
    
    .precio-simbolo {
        font-size: 40px;
    }
    
    .form-actions {
        padding: 24px;
        flex-direction: column-reverse;
    }
    
    .btn-primary.btn-submit,
    .btn-secondary {
        width: 100%;
        padding: 14px 24px;
        font-size: 15px;
        min-width: unset;
    }
}

@media (max-width: 480px) {
    .form-title {
        font-size: 24px;
    }
    
    .progress-indicator {
        padding: 10px 2px;
    }
    
    .progress-steps {
        padding: 0;
        justify-content: space-between;
        gap: 0;
    }
    
    .progress-steps::before {
        left: 20px;
        right: 20px;
        top: 12px;
    }
    
    .step {
        padding: 0;
        gap: 3px;
        flex: 0 1 16%;
        max-width: 16%;
    }
    
    .step-number {
        width: 24px;
        height: 24px;
        font-size: 9px;
    }
    
    .step-label {
        font-size: 6px;
        letter-spacing: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1;
    }
    
    .form-section {
        padding: 24px 16px;
    }
    
    .form-section h3 {
        font-size: 16px;
    }
    
    .checkbox-label {
        padding: 12px;
    }
    
    .checkbox-label span {
        font-size: 14px;
    }
}

/* Animaciones de carga */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Mejoras de accesibilidad */
.form-group input:focus-visible,
.form-group select:focus-visible,
.checkbox-label:focus-within {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .auto-agendamiento-container {
        box-shadow: none;
        border: 1px solid var(--border-color);
    }
    
    .btn-primary,
    .form-actions {
        display: none;
    }
}

/* Modal de Cursos Comprados */
.cursos-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.75);
    display: flex !important;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    padding: 20px;
    backdrop-filter: blur(8px);
    animation: fadeInModal 0.3s ease-out;
}

@keyframes fadeInModal {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.cursos-modal-content {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 100%;
    max-height: 85vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUpModal 0.3s ease-out;
}

@keyframes slideUpModal {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Simple */
.cursos-modal-header-simple {
    padding: 24px 32px;
    background: var(--primary-color);
    border-radius: 16px 16px 0 0;
}

.cursos-modal-header-simple h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #1a1a1a;
    text-align: center;
}

/* Body Simple */
.cursos-modal-body-simple {
    padding: 32px 40px;
    overflow-y: auto;
    flex: 1;
    background: #ffffff;
    max-height: 60vh;
}

.cursos-modal-body-simple::-webkit-scrollbar {
    width: 6px;
}

.cursos-modal-body-simple::-webkit-scrollbar-track {
    background: transparent;
}

.cursos-modal-body-simple::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 3px;
}

.cursos-intro-text {
    font-size: 15px;
    font-weight: 400;
    color: #333333;
    margin: 0 0 20px 0;
    line-height: 1.6;
}

.cursos-lista-simple {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-bottom: 20px;
}

.curso-item-simple {
    padding: 14px 18px;
    border-left: 4px solid var(--primary-color);
    background: #f5f5f5;
    margin-bottom: 12px;
}

.curso-item-simple:last-child {
    margin-bottom: 0;
}

.curso-item-simple p {
    margin: 4px 0;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.5;
}

.curso-item-simple p:first-child {
    margin-top: 0;
}

.curso-item-simple p:last-child {
    margin-bottom: 0;
}

.curso-item-simple strong {
    font-weight: 600;
    color: #000000;
}

.cursos-footer-text {
    font-size: 14px;
    font-weight: 400;
    color: #666666;
    margin: 0;
    line-height: 1.6;
}

/* Footer Simple */
.cursos-modal-footer-simple {
    padding: 28px 40px;
    background: #ffffff;
    display: flex;
    justify-content: center;
    border-radius: 0 0 16px 16px;
}

.btn-entendido {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 60px;
    font-size: 16px;
    font-weight: 600;
    color: #ffffff;
    background: #000000;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-entendido:hover {
    background: #333333;
}

.btn-entendido:active {
    background: #000000;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .cursos-modal {
        padding: 16px;
    }
    
    .cursos-modal-content {
        max-height: 90vh;
        max-width: 95%;
    }
    
    .cursos-modal-header-simple {
        padding: 20px 24px;
    }
    
    .cursos-modal-header-simple h3 {
        font-size: 24px;
    }
    
    .cursos-modal-body-simple {
        padding: 24px;
        max-height: 55vh;
    }
    
    .cursos-intro-text {
        font-size: 15px;
    }
    
    .curso-item-simple {
        padding: 14px 16px;
        border-left-width: 3px;
    }
    
    .curso-item-simple p {
        font-size: 13px;
    }
    
    .cursos-footer-text {
        font-size: 13px;
    }
    
    .cursos-modal-footer-simple {
        padding: 20px 24px;
    }
    
    .btn-entendido {
        width: 100%;
        padding: 12px 32px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .cursos-modal {
        padding: 12px;
    }
    
    .cursos-modal-content {
        max-height: 92vh;
        max-width: 98%;
    }
    
    .cursos-modal-header-simple {
        padding: 18px 20px;
    }
    
    .cursos-modal-header-simple h3 {
        font-size: 22px;
    }
    
    .cursos-modal-body-simple {
        padding: 20px;
        max-height: 50vh;
    }
    
    .cursos-intro-text {
        font-size: 14px;
        margin-bottom: 20px;
    }
    
    .curso-item-simple {
        padding: 12px 14px;
        margin-bottom: 12px;
    }
    
    .curso-item-simple p {
        font-size: 12px;
        margin: 5px 0;
    }
    
    .cursos-footer-text {
        font-size: 12px;
    }
    
    .cursos-modal-footer-simple {
        padding: 18px 20px;
    }
    
    .btn-entendido {
        padding: 12px 24px;
        font-size: 14px;
    }
}

/* ===========================================
   FLATPICKR - Estilos personalizados
   =========================================== */

/* Campo de fecha de nacimiento */
#fecha_nacimiento,
#fecha_nacimiento + .flatpickr-input {
    cursor: pointer;
    background-color: var(--bg-white);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 20px;
    padding-right: 48px !important;
}

#fecha_nacimiento + .flatpickr-input:focus,
#fecha_nacimiento + .flatpickr-input.active {
    border-color: var(--border-focus);
    box-shadow: 0 0 0 3px rgba(255, 213, 0, 0.15);
    outline: none;
}

#fecha_nacimiento + .flatpickr-input.valid {
    border-color: var(--success-color);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2310b981' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
}

#fecha_nacimiento + .flatpickr-input.error {
    border-color: var(--error-color);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23ef4444' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3E%3C/rect%3E%3Cline x1='16' y1='2' x2='16' y2='6'%3E%3C/line%3E%3Cline x1='8' y1='2' x2='8' y2='6'%3E%3C/line%3E%3Cline x1='3' y1='10' x2='21' y2='10'%3E%3C/line%3E%3C/svg%3E");
}

/* Hint de campo */
.field-hint {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: var(--text-secondary);
    transition: var(--transition);
}

.field-hint strong {
    color: var(--success-color);
    font-weight: 600;
}

.field-hint.error-hint {
    color: var(--error-color);
}

/* Mensaje para menores de edad (17 años) */
.field-hint .hint-menor-edad,
.hint-menor-edad {
    display: block !important;
    margin-top: 8px !important;
    padding: 12px 16px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #1a1a1a !important;
    background-color: #ffd500 !important;
    border: 1px solid #e6c000 !important;
    border-radius: 8px !important;
    line-height: 1.5 !important;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05) !important;
}

/* Contenedor del calendario Flatpickr */
.flatpickr-calendar {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif !important;
    border-radius: var(--radius-lg) !important;
    box-shadow: var(--shadow-xl) !important;
    border: 1px solid var(--border-color) !important;
    background: var(--bg-white) !important;
    padding: 8px !important;
    width: 320px !important;
}

.flatpickr-calendar.open {
    animation: flatpickrFadeIn 0.2s ease-out;
}

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

/* Header del calendario (meses/años) */
.flatpickr-months {
    padding: 8px 4px !important;
}

.flatpickr-months .flatpickr-month {
    height: 40px !important;
}

.flatpickr-current-month {
    font-size: 15px !important;
    font-weight: 600 !important;
    color: var(--text-primary) !important;
    padding-top: 8px !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months {
    font-weight: 600 !important;
    background: transparent !important;
    border: none !important;
    font-size: 15px !important;
    cursor: pointer !important;
    padding: 4px 8px !important;
    border-radius: var(--radius-sm) !important;
    transition: var(--transition) !important;
}

.flatpickr-current-month .flatpickr-monthDropdown-months:hover {
    background: var(--bg-gray) !important;
}

.flatpickr-current-month input.cur-year {
    font-weight: 600 !important;
    font-size: 15px !important;
    background: transparent !important;
    border: none !important;
    padding: 4px 8px !important;
    border-radius: var(--radius-sm) !important;
    transition: var(--transition) !important;
}

.flatpickr-current-month input.cur-year:hover {
    background: var(--bg-gray) !important;
}

/* Flechas de navegación */
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    width: 36px !important;
    height: 36px !important;
    padding: 8px !important;
    border-radius: var(--radius-md) !important;
    transition: var(--transition) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    top: 10px !important;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    background: var(--primary-light) !important;
}

.flatpickr-months .flatpickr-prev-month svg,
.flatpickr-months .flatpickr-next-month svg {
    fill: var(--text-primary) !important;
    width: 14px !important;
    height: 14px !important;
}

/* Días de la semana */
.flatpickr-weekdays {
    height: 36px !important;
    background: transparent !important;
}

.flatpickr-weekday {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: var(--text-secondary) !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
}

/* Contenedor de días */
.flatpickr-days {
    width: 100% !important;
}

.dayContainer {
    width: 100% !important;
    min-width: 100% !important;
    max-width: 100% !important;
}

/* Días individuales */
.flatpickr-day {
    width: 40px !important;
    height: 40px !important;
    line-height: 40px !important;
    margin: 2px !important;
    border-radius: var(--radius-md) !important;
    font-size: 14px !important;
    font-weight: 500 !important;
    color: var(--text-primary) !important;
    border: none !important;
    transition: var(--transition) !important;
}

.flatpickr-day:hover {
    background: var(--primary-light) !important;
    border-color: transparent !important;
}

.flatpickr-day.today {
    background: var(--bg-gray) !important;
    border: 2px solid var(--primary-color) !important;
    font-weight: 700 !important;
}

.flatpickr-day.today:hover {
    background: var(--primary-light) !important;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: var(--text-primary) !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 12px rgba(255, 213, 0, 0.4) !important;
}

/* Días deshabilitados (fuera del rango de edad) */
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover {
    color: var(--text-light) !important;
    background: transparent !important;
    cursor: not-allowed !important;
    opacity: 0.4 !important;
    text-decoration: line-through !important;
}

/* Días de otro mes */
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--text-light) !important;
    opacity: 0.5 !important;
}

.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
    background: var(--bg-light) !important;
}

/* Ocultar el input original (flatpickr usa altInput) */
#fecha_nacimiento[readonly] {
    display: none;
}

/* Responsive para el calendario */
@media (max-width: 380px) {
    .flatpickr-calendar {
        width: 280px !important;
    }
    
    .flatpickr-day {
        width: 34px !important;
        height: 34px !important;
        line-height: 34px !important;
        font-size: 13px !important;
    }
}

/* =========================================
   CONTADOR DE TIEMPO DE SESIÓN
   ========================================= */
.session-timer-container {
    margin-bottom: 20px;
}

.session-timer-box {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-color);
    padding: 20px 28px;
    position: relative;
    overflow: hidden;
}

.session-timer-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--primary-color);
}

.session-timer-inner {
    display: flex;
    align-items: center;
    gap: 16px;
}

.timer-icon-wrapper {
    width: 48px;
    height: 48px;
    background: var(--primary-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    flex-shrink: 0;
}

.timer-icon-wrapper svg {
    color: var(--text-primary);
}

.timer-text-wrapper {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.timer-label-text {
    font-size: 13px;
    color: var(--text-secondary);
    font-weight: 500;
}

.timer-countdown {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.timer-digits {
    font-size: 32px;
    font-weight: 700;
    color: var(--text-primary);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', sans-serif;
    font-variant-numeric: tabular-nums;
    letter-spacing: 1px;
}

.timer-digits.warning {
    color: var(--warning-color);
}

.timer-digits.danger {
    color: var(--error-color);
    animation: timerBlink 0.5s ease-in-out infinite;
}

@keyframes timerBlink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.timer-progress-container {
    height: 6px;
    background: var(--bg-gray);
    border-radius: 3px;
    margin-top: 16px;
    overflow: hidden;
}

.timer-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-hover));
    border-radius: 3px;
    width: 100%;
    transition: width 1s linear;
}

.timer-progress-fill.warning {
    background: linear-gradient(90deg, var(--warning-color), #fbbf24);
}

.timer-progress-fill.danger {
    background: linear-gradient(90deg, var(--error-color), #f87171);
}

/* Modal de tiempo expirado */
.timer-expired-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
    padding: 20px;
}

.timer-expired-modal.active {
    opacity: 1;
    visibility: visible;
}

.timer-expired-content {
    background: var(--bg-white);
    border-radius: var(--radius-xl);
    padding: 40px;
    max-width: 420px;
    width: 100%;
    text-align: center;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: var(--shadow-xl);
}

.timer-expired-modal.active .timer-expired-content {
    transform: scale(1);
}

.timer-expired-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 20px;
    background: var(--error-light);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.timer-expired-icon svg {
    width: 36px;
    height: 36px;
    color: var(--error-color);
}

.timer-expired-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    margin: 0 0 12px;
}

.timer-expired-message {
    font-size: 15px;
    color: var(--text-secondary);
    margin: 0 0 28px;
    line-height: 1.6;
}

.timer-expired-btn {
    background: var(--primary-color);
    color: var(--text-primary);
    border: none;
    padding: 14px 32px;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
}

.timer-expired-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
}

/* Responsive para el contador */
@media (max-width: 768px) {
    .session-timer-box {
        padding: 16px 20px;
    }
    
    .session-timer-inner {
        gap: 12px;
    }
    
    .timer-icon-wrapper {
        width: 40px;
        height: 40px;
    }
    
    .timer-icon-wrapper svg {
        width: 20px;
        height: 20px;
    }
    
    .timer-label-text {
        font-size: 12px;
    }
    
    .timer-digits {
        font-size: 26px;
    }
    
    .timer-expired-content {
        padding: 32px 24px;
    }
    
    .timer-expired-icon {
        width: 64px;
        height: 64px;
    }
    
    .timer-expired-icon svg {
        width: 32px;
        height: 32px;
    }
    
    .timer-expired-title {
        font-size: 20px;
    }
    
    .timer-expired-message {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .session-timer-box {
        padding: 14px 16px;
    }
    
    .session-timer-inner {
        gap: 10px;
    }
    
    .timer-icon-wrapper {
        width: 36px;
        height: 36px;
    }
    
    .timer-icon-wrapper svg {
        width: 18px;
        height: 18px;
    }
    
    .timer-digits {
        font-size: 22px;
    }
    
    .timer-label-text {
        font-size: 11px;
    }
    
    .timer-progress-container {
        margin-top: 12px;
    }
}