/* CS Pro - Estilos del Frontend Público */

/* Contenedor principal del formulario */
.cs-pro-form-container {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* Título del formulario */
.cs-pro-form-title {
    margin: 0 0 15px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    text-align: center;
}

/* Descripción del formulario */
.cs-pro-form-description {
    margin: 0 0 25px 0;
    color: #666;
    text-align: center;
    line-height: 1.5;
}

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

.cs-pro-message {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.4;
}

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

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

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

/* Campos del formulario */
.cs-pro-field {
    margin-bottom: 20px;
}

.cs-pro-field-label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.cs-pro-required {
    color: #e74c3c;
    font-weight: bold;
}

/* Inputs generales */
.cs-pro-input,
.cs-pro-textarea,
.cs-pro-select {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1.4;
    background-color: #ffffff;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.cs-pro-input:focus,
.cs-pro-textarea:focus,
.cs-pro-select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.cs-pro-input.error,
.cs-pro-textarea.error,
.cs-pro-select.error {
    border-color: #e74c3c;
}

.cs-pro-input.error:focus,
.cs-pro-textarea.error:focus,
.cs-pro-select.error:focus {
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

/* Textarea específico */
.cs-pro-textarea {
    resize: vertical;
    min-height: 100px;
}

/* Select específico */
.cs-pro-select {
    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: 16px;
    padding-right: 40px;
    appearance: none;
}

/* Radio buttons */
.cs-pro-radio-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cs-pro-radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    font-size: 14px;
}

.cs-pro-radio {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #3498db;
}

.cs-pro-radio-text {
    color: #333;
}

/* Checkboxes */
.cs-pro-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.cs-pro-checkbox-group-label {
    display: block;
    margin-bottom: 10px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.cs-pro-checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    padding: 8px 0;
    font-size: 14px;
}

.cs-pro-checkbox {
    margin-right: 10px;
    width: 18px;
    height: 18px;
    accent-color: #3498db;
}

.cs-pro-checkbox-text {
    color: #333;
}

/* File input */
.cs-pro-file {
    width: 100%;
    padding: 12px 16px;
    border: 2px dashed #e1e5e9;
    border-radius: 6px;
    background-color: #f8f9fa;
    cursor: pointer;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.cs-pro-file:hover {
    border-color: #3498db;
    background-color: #f0f8ff;
}

.cs-pro-file:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.cs-pro-file-info {
    margin-top: 8px;
    font-size: 12px;
    color: #666;
}

/* Botón de envío */
.cs-pro-form-submit {
    text-align: center;
    margin-top: 30px;
}

.cs-pro-submit-btn {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 14px 32px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    min-width: 120px;
}

.cs-pro-submit-btn:hover {
    background: linear-gradient(135deg, #2980b9, #1f5f8b);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.cs-pro-submit-btn:active {
    transform: translateY(0);
}

.cs-pro-submit-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.cs-pro-submit-loading {
    display: inline-block;
}

.cs-pro-submit-loading::after {
    content: "";
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: cs-pro-spin 1s linear infinite;
}

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

/* Estados de validación */
.cs-pro-field.has-error .cs-pro-input,
.cs-pro-field.has-error .cs-pro-textarea,
.cs-pro-field.has-error .cs-pro-select {
    border-color: #e74c3c;
}

.cs-pro-field-error {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.cs-pro-field.has-success .cs-pro-input,
.cs-pro-field.has-success .cs-pro-textarea,
.cs-pro-field.has-success .cs-pro-select {
    border-color: #27ae60;
}

/* Responsive */
@media (max-width: 768px) {
    .cs-pro-form-container {
        margin: 0 15px;
        padding: 15px;
    }
    
    .cs-pro-form-title {
        font-size: 20px;
    }
    
    .cs-pro-input,
    .cs-pro-textarea,
    .cs-pro-select {
        font-size: 16px; /* Evita zoom en iOS */
    }
    
    .cs-pro-radio-group,
    .cs-pro-checkbox-group {
        gap: 8px;
    }
    
    .cs-pro-submit-btn {
        width: 100%;
        padding: 16px;
    }
}

@media (max-width: 480px) {
    .cs-pro-form-container {
        margin: 0 10px;
        padding: 12px;
    }
    
    .cs-pro-field {
        margin-bottom: 16px;
    }
    
    .cs-pro-form-title {
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .cs-pro-form-description {
        margin-bottom: 20px;
        font-size: 14px;
    }
}

/* Animaciones */
.cs-pro-field {
    opacity: 0;
    transform: translateY(20px);
    animation: cs-pro-fadeInUp 0.6s ease forwards;
}

.cs-pro-field:nth-child(1) { animation-delay: 0.1s; }
.cs-pro-field:nth-child(2) { animation-delay: 0.2s; }
.cs-pro-field:nth-child(3) { animation-delay: 0.3s; }
.cs-pro-field:nth-child(4) { animation-delay: 0.4s; }
.cs-pro-field:nth-child(5) { animation-delay: 0.5s; }

@keyframes cs-pro-fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tema oscuro */
@media (prefers-color-scheme: dark) {
    .cs-pro-form-container {
        background: #2c3e50;
        color: #ecf0f1;
    }
    
    .cs-pro-form-title {
        color: #ecf0f1;
    }
    
    .cs-pro-form-description {
        color: #bdc3c7;
    }
    
    .cs-pro-field-label {
        color: #ecf0f1;
    }
    
    .cs-pro-input,
    .cs-pro-textarea,
    .cs-pro-select {
        background-color: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .cs-pro-input:focus,
    .cs-pro-textarea:focus,
    .cs-pro-select:focus {
        border-color: #3498db;
    }
    
    .cs-pro-radio-text,
    .cs-pro-checkbox-text {
        color: #ecf0f1;
    }
    
    .cs-pro-file {
        background-color: #34495e;
        border-color: #4a5f7a;
        color: #ecf0f1;
    }
    
    .cs-pro-file:hover {
        background-color: #3d566e;
    }
}

/* Accesibilidad */
.cs-pro-input:focus,
.cs-pro-textarea:focus,
.cs-pro-select:focus,
.cs-pro-radio:focus,
.cs-pro-checkbox:focus,
.cs-pro-file:focus,
.cs-pro-submit-btn:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

/* Reducir movimiento para usuarios que lo prefieren */
@media (prefers-reduced-motion: reduce) {
    .cs-pro-field {
        animation: none;
        opacity: 1;
        transform: none;
    }
    
    .cs-pro-submit-btn {
        transition: none;
    }
    
    .cs-pro-submit-btn:hover {
        transform: none;
    }
}