/**
 * Estilos para el Plugin de Universidad
 * Central Uniformes - Formulario de Estudiantes
 */

/* ===========================
   LANDING UNIVERSIDAD
   =========================== */

.cu-landing-universidad-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cu-landing-content {
    margin-bottom: 60px;
}

.cu-landing-form-section {
    background: #f8f9fa;
    padding: 60px 20px;
    margin: 40px 0;
    border-radius: 8px;
}

.cu-landing-form-container {
    max-width: 600px;
    margin: 0 auto;
}

.cu-form-header {
    text-align: center;
    margin-bottom: 40px;
}

.cu-form-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
}

.cu-form-header p {
    font-size: 16px;
    color: #666;
    line-height: 1.6;
}

/* ===========================
   FORMULARIO DE REGISTRO
   =========================== */

.cu-student-registration-form-wrapper {
    background: #ffffff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.cu-form-title {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 25px;
    text-align: center;
}

/* Mensajes del formulario */
.cu-form-messages {
    margin-bottom: 20px;
}

.cu-form-message {
    padding: 15px 20px;
    border-radius: 5px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.5;
}

.cu-form-message.success {
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.cu-form-message.error {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.cu-form-message.warning {
    background-color: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

/* Estructura del formulario */
.cu-student-form {
    width: 100%;
}

.cu-form-row {
    margin-bottom: 25px;
}

.cu-form-field {
    width: 100%;
}

.cu-form-field label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.cu-form-field label .required {
    color: #dc3545;
    margin-left: 3px;
}

/* Inputs */
.cu-input {
    width: 100%;
    padding: 12px 15px;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
    background-color: #fff;
    border: 1px solid #d1d1d1;
    border-radius: 5px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.cu-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0, 115, 170, 0.1);
}

.cu-input:invalid:not(:focus):not(:placeholder-shown) {
    border-color: #dc3545;
}

.cu-input.error {
    border-color: #dc3545;
}

.cu-field-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

/* Checkbox de privacidad */
.cu-field-privacy {
    margin-top: 20px;
}

.cu-checkbox-label {
    display: flex;
    align-items: flex-start;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    font-weight: normal;
}

.cu-checkbox-label input[type="checkbox"] {
    margin-right: 10px;
    margin-top: 3px;
    width: 18px;
    height: 18px;
    cursor: pointer;
    flex-shrink: 0;
}

.cu-checkbox-label a {
    color: #0073aa;
    text-decoration: underline;
}

.cu-checkbox-label a:hover {
    color: #005177;
}

/* Botones */
.cu-form-actions {
    margin-top: 30px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.cu-submit-button {
    background-color: #0073aa;
    color: #ffffff;
    font-size: 16px;
    font-weight: 600;
    padding: 14px 40px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    box-shadow: 0 2px 5px rgba(0, 115, 170, 0.2);
}

.cu-submit-button:hover {
    background-color: #005177;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 115, 170, 0.3);
}

.cu-submit-button:active {
    transform: translateY(0);
}

.cu-submit-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}

/* Spinner de carga */
.cu-loading-spinner {
    display: inline-flex;
    align-items: center;
}

.cu-loading-spinner .spinner {
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: cu-spin 1s linear infinite;
}

@keyframes cu-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Estados del formulario */
.cu-student-form.processing {
    opacity: 0.7;
    pointer-events: none;
}

.cu-student-form.processing .cu-submit-button {
    background-color: #ccc;
}

/* ===========================
   RESPONSIVE
   =========================== */

@media (max-width: 768px) {
    .cu-landing-universidad-wrapper {
        padding: 15px;
    }

    .cu-landing-form-section {
        padding: 40px 15px;
        margin: 30px 0;
    }

    .cu-student-registration-form-wrapper {
        padding: 20px;
    }

    .cu-form-header h2 {
        font-size: 26px;
    }

    .cu-form-header p {
        font-size: 14px;
    }

    .cu-form-title {
        font-size: 20px;
    }

    .cu-input {
        padding: 10px 12px;
        font-size: 14px;
    }

    .cu-submit-button {
        width: 100%;
        padding: 12px 20px;
        font-size: 15px;
    }

    .cu-form-actions {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .cu-form-header h2 {
        font-size: 22px;
    }

    .cu-form-row {
        margin-bottom: 20px;
    }

    .cu-checkbox-label {
        font-size: 13px;
    }
}

/* ===========================
   ACCESIBILIDAD
   =========================== */

/* Focus visible para navegación por teclado */
.cu-input:focus-visible,
.cu-submit-button:focus-visible,
.cu-checkbox-label input:focus-visible {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

/* Alto contraste */
@media (prefers-contrast: high) {
    .cu-input {
        border-width: 2px;
    }

    .cu-submit-button {
        border: 2px solid #000;
    }
}

/* Reducir movimiento */
@media (prefers-reduced-motion: reduce) {
    .cu-input,
    .cu-submit-button,
    .cu-loading-spinner .spinner {
        transition: none;
        animation: none;
    }
}

/* ===========================
   COMPATIBILIDAD CON TEMAS
   =========================== */

/* Reset de estilos que puedan interferir */
.cu-student-registration-form-wrapper * {
    box-sizing: border-box;
}

.cu-student-registration-form-wrapper input[type="text"],
.cu-student-registration-form-wrapper input[type="email"] {
    max-width: 100%;
}

/* Compatibilidad con temas oscuros */
@media (prefers-color-scheme: dark) {
    .cu-landing-form-section {
        background: #2a2a2a;
    }

    .cu-student-registration-form-wrapper {
        background: #1a1a1a;
        box-shadow: 0 2px 10px rgba(255, 255, 255, 0.1);
    }

    .cu-form-header h2,
    .cu-form-title {
        color: #f0f0f0;
    }

    .cu-form-header p,
    .cu-form-field label,
    .cu-checkbox-label,
    .cu-field-help {
        color: #d0d0d0;
    }

    .cu-input {
        background-color: #2a2a2a;
        border-color: #444;
        color: #f0f0f0;
    }

    .cu-input:focus {
        border-color: #4a9eff;
        box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
    }
}
