/* ========================================
   Formulario de Registro con Promoción
   Estilos Responsivos
   ======================================== */

/* Variables CSS */
:root {
    --frp-primary: #2563eb;
    --frp-primary-dark: #1d4ed8;
    --frp-success: #10b981;
    --frp-error: #ef4444;
    --frp-text: #1f2937;
    --frp-text-light: #6b7280;
    --frp-border: #e5e7eb;
    --frp-bg: #ffffff;
    --frp-bg-light: #f9fafb;
    --frp-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    --frp-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --frp-radius: 0.5rem;
}

/* Reset de Box Sizing para todos los elementos del plugin */
.frp-container *,
.frp-container *::before,
.frp-container *::after {
    box-sizing: border-box;
}

/* Contenedor Principal */
.frp-container {
    width: 100%;
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Wrapper del Formulario */
.frp-form-wrapper {
    background: var(--frp-bg);
    border-radius: var(--frp-radius);
    box-shadow: var(--frp-shadow-lg);
    padding: 2rem;
}

/* Título */
.frp-titulo {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--frp-text);
    margin: 0 0 0.5rem 0;
    text-align: center;
}

/* Subtítulo */
.frp-subtitulo {
    font-size: 1rem;
    color: var(--frp-text-light);
    margin: 0 0 2rem 0;
    text-align: center;
}

/* Mensajes */
.frp-messages {
    margin-bottom: 1.5rem;
}

.frp-success-message,
.frp-error-message {
    padding: 1rem;
    border-radius: var(--frp-radius);
    margin-bottom: 1rem;
    font-size: 0.875rem;
    font-weight: 500;
}

.frp-success-message {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #10b981;
}

.frp-error-message {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #ef4444;
}

/* Formulario */
.frp-form {
    width: 100%;
}

/* Fila de Formulario */
.frp-form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

@media (min-width: 640px) {
    .frp-form-row {
        grid-template-columns: 1fr 1fr;
    }
}

/* Grupo de Formulario */
.frp-form-group {
    margin-bottom: 1rem;
}

/* Etiquetas */
.frp-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--frp-text);
    margin-bottom: 0.5rem;
}

.frp-required {
    color: var(--frp-error);
}

/* Inputs */
.frp-input {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    line-height: 1.5;
    color: var(--frp-text);
    background-color: var(--frp-bg);
    border: 1px solid var(--frp-border);
    border-radius: var(--frp-radius);
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.frp-input:focus {
    outline: none;
    border-color: var(--frp-primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.frp-input::placeholder {
    color: #9ca3af;
}

/* Texto de Ayuda */
.frp-help-text {
    display: block;
    margin-top: 0.5rem;
    font-size: 0.75rem;
    color: var(--frp-text-light);
}

/* File Upload Wrapper */
.frp-file-upload-wrapper {
    position: relative;
    width: 100%;
}

.frp-file-input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.frp-file-label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 200px;
    padding: 2rem;
    background-color: var(--frp-bg-light);
    border: 2px dashed var(--frp-border);
    border-radius: var(--frp-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    box-sizing: border-box;
}

.frp-file-label:hover {
    background-color: #f3f4f6;
    border-color: var(--frp-primary);
}

.frp-upload-icon {
    width: 48px;
    height: 48px;
    color: var(--frp-primary);
    margin-bottom: 1rem;
}

.frp-file-text {
    font-size: 1rem;
    font-weight: 500;
    color: var(--frp-text);
    text-align: center;
}

/* Preview de Imagen */
.frp-file-preview {
    position: relative;
    width: 100%;
    border-radius: var(--frp-radius);
    overflow: hidden;
    background-color: var(--frp-bg-light);
    border: 1px solid var(--frp-border);
    box-sizing: border-box;
}

.frp-preview-image {
    width: 100%;
    height: auto;
    display: block;
}

.frp-remove-image {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    width: 2rem;
    height: 2rem;
    background-color: var(--frp-error);
    color: white;
    border: none;
    border-radius: 50%;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: var(--frp-shadow);
}

.frp-remove-image:hover {
    background-color: #dc2626;
    transform: scale(1.1);
}

/* Checkbox de Términos */
.frp-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background-color: var(--frp-bg-light);
    border-radius: var(--frp-radius);
    border: 1px solid var(--frp-border);
}

.frp-checkbox {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.125rem;
    cursor: pointer;
    flex-shrink: 0;
}

.frp-checkbox-label {
    font-size: 0.875rem;
    color: var(--frp-text);
    line-height: 1.5;
    cursor: pointer;
    margin: 0;
}

.frp-link {
    color: var(--frp-primary);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s;
}

.frp-link:hover {
    color: var(--frp-primary-dark);
}

/* Modales */
.frp-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.frp-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
}

.frp-modal-content {
    position: relative;
    background: white;
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    z-index: 10001;
}

.frp-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--frp-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.frp-modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--frp-text);
}

.frp-modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--frp-text-light);
    cursor: pointer;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.frp-modal-close:hover {
    background-color: var(--frp-bg-light);
    color: var(--frp-text);
}

.frp-modal-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.frp-modal-body h3 {
    color: var(--frp-primary);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.125rem;
}

.frp-modal-body h3:first-child {
    margin-top: 0;
}

.frp-modal-body p {
    margin-bottom: 1rem;
    line-height: 1.6;
    color: var(--frp-text);
}

.frp-modal-body ul {
    margin: 0.5rem 0 1rem 1.5rem;
    line-height: 1.8;
}

.frp-modal-body li {
    color: var(--frp-text);
}

.frp-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--frp-border);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.frp-btn-secondary {
    padding: 0.75rem 1.5rem;
    background-color: var(--frp-bg-light);
    color: var(--frp-text);
    border: 1px solid var(--frp-border);
    border-radius: var(--frp-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.frp-btn-secondary:hover {
    background-color: #e5e7eb;
}

/* Botón de Envío */
.frp-submit-btn {
    width: 100%;
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background-color: var(--frp-primary);
    border: none;
    border-radius: var(--frp-radius);
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: var(--frp-shadow);
}

.frp-submit-btn:hover {
    background-color: var(--frp-primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--frp-shadow-lg);
}

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

.frp-submit-btn:disabled {
    background-color: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Spinner de Carga */
.frp-spinner {
    animation: frp-spin 1s linear infinite;
}

@keyframes frp-spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

/* Responsive - Móviles */
@media (max-width: 639px) {
    .frp-container {
        padding: 0 0.5rem;
        margin: 1rem auto;
    }
    
    .frp-form-wrapper {
        padding: 1.5rem 1rem;
    }
    
    .frp-titulo {
        font-size: 1.5rem;
    }
    
    .frp-subtitulo {
        font-size: 0.875rem;
    }
    
    .frp-file-label {
        min-height: 150px;
        padding: 1.5rem 1rem;
    }
    
    .frp-upload-icon {
        width: 36px;
        height: 36px;
    }
    
    .frp-file-text {
        font-size: 0.875rem;
    }
    
    .frp-modal-content {
        max-height: 95vh;
        margin: 0.5rem;
    }
    
    .frp-modal-header {
        padding: 1rem;
    }
    
    .frp-modal-header h2 {
        font-size: 1.25rem;
    }
    
    .frp-modal-body {
        padding: 1rem;
    }
    
    .frp-modal-footer {
        padding: 1rem;
    }
    
    .frp-checkbox-label {
        font-size: 0.8125rem;
    }
}

/* Tablets */
@media (min-width: 640px) and (max-width: 1023px) {
    .frp-container {
        max-width: 540px;
    }
}

/* Desktop */
@media (min-width: 1024px) {
    .frp-container {
        max-width: 600px;
    }
}

/* Accesibilidad */
.frp-input:focus-visible,
.frp-file-label:focus-within,
.frp-submit-btn:focus-visible {
    outline: 2px solid var(--frp-primary);
    outline-offset: 2px;
}

/* Estados de Validación */
.frp-input:invalid:not(:placeholder-shown) {
    border-color: var(--frp-error);
}

.frp-input:valid:not(:placeholder-shown) {
    border-color: var(--frp-success);
}

/* Animaciones */
@keyframes frp-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.frp-success-message,
.frp-error-message {
    animation: frp-fadeIn 0.3s ease;
}

/* Dark Mode Support (opcional) */
@media (prefers-color-scheme: dark) {
    :root {
        --frp-text: #f9fafb;
        --frp-text-light: #d1d5db;
        --frp-border: #374151;
        --frp-bg: #1f2937;
        --frp-bg-light: #111827;
    }
    
    .frp-input {
        background-color: #374151;
        color: #f9fafb;
    }
    
    .frp-file-label {
        background-color: #374151;
    }
    
    .frp-file-label:hover {
        background-color: #4b5563;
    }
}
