/* ===== VARIABLES CSS ===== */
:root {
    --primary-color: #ff0000;
    --primary-light: #ff3333;
    --primary-dark: #cc0000;
    --bg-dark: #0c0c0c;
    --bg-card: rgba(20, 20, 20, 0.9);
    --bg-input: rgba(40, 40, 40, 0.8);
    --text-light: #fff;
    --text-muted: rgba(255, 255, 255, 0.6);
    --success-color: #4CAF50;
    --error-color: #ff3333;
    --warning-color: #ff9800;
    --border-radius: 12px;
    --transition: all 0.3s ease;
    --shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-light: 0 5px 15px rgba(255, 0, 0, 0.3);
    --focus-outline: 2px solid var(--primary-color);
    --focus-outline-offset: 2px;
}

/* ===== RESET Y ESTILOS BASE ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-dark);
    color: var(--text-light);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(150, 0, 0, 0.1) 0%, transparent 20%),
        radial-gradient(circle at 90% 80%, rgba(150, 0, 0, 0.1) 0%, transparent 20%);
    line-height: 1.6;
}

/* ===== CONTENEDOR PRINCIPAL ===== */
.form-container {
    width: 100%;
    max-width: 500px;
    position: relative;
}

/* ===== TARJETA DEL FORMULARIO ===== */
.dark-form {
    background: var(--bg-card);
    border-radius: 20px;
    border: 1px solid rgba(255, 0, 0, 0.3);
    padding: 40px;
    box-shadow: var(--shadow), 0 0 20px rgba(255, 0, 0, 0.2);
    position: relative;
    overflow: hidden;
    z-index: 1;
    backdrop-filter: blur(10px);
}

.dark-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-light), var(--primary-color));
    box-shadow: 0 0 10px rgba(255, 0, 0, 0.5);
}

/* ===== ENCABEZADO DEL FORMULARIO ===== */
.form-header {
    text-align: center;
    margin-bottom: 35px;
}

.form-title {
    font-size: 2.2rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: linear-gradient(90deg, #fff, #ff6b6b, #fff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    text-shadow: 0 0 10px rgba(255, 0, 0, 0.3);
}

.form-subtitle {
    font-size: 1rem;
    opacity: 0.8;
    color: var(--text-muted);
}

/* ===== GRUPOS DE FORMULARIO ===== */
.form-group {
    position: relative;
    margin-bottom: 25px;
}

.form-input {
    width: 100%;
    padding: 15px 20px;
    background: var(--bg-input);
    border: 2px solid rgba(80, 80, 80, 0.5);
    border-radius: var(--border-radius);
    font-size: 1rem;
    color: var(--text-light);
    transition: var(--transition);
    outline: none;
}

.form-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

.form-input:focus {
    background: rgba(50, 50, 50, 0.9);
    border-color: var(--primary-light);
    box-shadow: 0 0 15px rgba(255, 0, 0, 0.3);
}

.form-input:focus-visible {
    outline: var(--focus-outline);
    outline-offset: var(--focus-outline-offset);
}

.form-input:hover {
    border-color: rgba(255, 80, 80, 0.7);
}

textarea.form-input {
    min-height: 120px;
    resize: vertical;
}

/* ===== ETIQUETAS FLOTANTES ===== */
.form-label {
    position: absolute;
    top: 15px;
    left: 20px;
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
    transition: var(--transition);
    background: var(--bg-card);
    padding: 0 5px;
}

.form-input:focus + .form-label,
.form-input:not(:placeholder-shown) + .form-label {
    top: -10px;
    left: 15px;
    font-size: 0.8rem;
    color: var(--primary-light);
    font-weight: 600;
}

/* ===== BOTÓN DE ENVÍO ===== */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    border: none;
    color: white;
    border-radius: var(--border-radius);
    padding: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-light);
    will-change: transform;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.submit-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-color));
    transform: translateY(-3px);
    box-shadow: 0 10px 20px rgba(255, 0, 0, 0.4);
}

.submit-btn:hover:not(:disabled)::before {
    left: 100%;
}

.submit-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none !important;
    background: linear-gradient(135deg, #cc0000, #990000);
}

.submit-btn.loading {
    pointer-events: none;
}

/* ===== SPINNER DE CARGA ===== */
.btn-spinner {
    display: none;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.submit-btn.loading .btn-spinner {
    display: block;
}

.btn-text {
    transition: opacity 0.3s;
}

.submit-btn.loading .btn-text {
    opacity: 0.7;
}

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

/* ===== MENSAJES DE FEEDBACK ===== */
.form-feedback {
    padding: 15px;
    border-radius: var(--border-radius);
    margin-top: 20px;
    text-align: center;
    font-weight: 600;
    display: none;
    background: var(--bg-input);
    border: 1px solid rgba(255, 0, 0, 0.3);
}

.form-feedback.success {
    color: var(--success-color);
    display: block;
    animation: fadeIn 0.5s;
    border-color: rgba(76, 175, 80, 0.5);
}

.form-feedback.error {
    color: var(--error-color);
    display: block;
    animation: fadeIn 0.5s;
    border-color: rgba(255, 51, 51, 0.5);
}

.form-feedback.warning {
    color: var(--warning-color);
    display: block;
    animation: fadeIn 0.5s;
    border-color: rgba(255, 152, 0, 0.5);
}

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

/* ===== ELEMENTOS DECORATIVOS FLOTANTES ===== */
.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: -1;
    border-radius: 20px;
}

.shape {
    position: absolute;
    background: rgba(255, 0, 0, 0.1);
    border-radius: 50%;
    animation: float 15s infinite linear;
    will-change: transform, opacity;
}

@keyframes float {
    0% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.5;
    }
    50% {
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.8;
    }
    100% {
        transform: translateY(0) rotate(360deg);
        opacity: 0.5;
    }
}

/* ===== ICONOS DE ENTRADA ===== */
.input-icon {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    transition: var(--transition);
}

.form-input:focus ~ .input-icon {
    color: var(--primary-light);
    transform: translateY(-50%) scale(1.1);
}

.form-input:hover ~ .input-icon {
    color: rgba(255, 80, 80, 0.8);
}

/* ===== MENSAJES DE ERROR ===== */
.error-message {
    color: var(--error-color);
    font-size: 0.8rem;
    margin-top: 5px;
    display: none;
    font-weight: 500;
}

.form-group.error .form-input {
    border-color: rgba(255, 51, 51, 0.6);
    box-shadow: 0 0 10px rgba(255, 51, 51, 0.2);
}

.form-group.error .input-icon {
    color: var(--error-color);
}

.form-group.error .error-message {
    display: block;
    animation: fadeIn 0.3s;
}

.form-group.success .form-input {
    border-color: rgba(76, 175, 80, 0.6);
}

.form-group.success .input-icon {
    color: var(--success-color);
}

/* ===== INFORMACIÓN DE WHATSAPP ===== */
.whatsapp-info {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    color: #25D366;
    font-weight: 500;
}

.whatsapp-info i {
    font-size: 1.2rem;
}

/* ===== MEJORAS DE ACCESIBILIDAD ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 576px) {
    .dark-form {
        padding: 30px 25px;
    }
    
    .form-title {
        font-size: 1.8rem;
    }
}

/* ===== PREFERS REDUCED MOTION ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .shape {
        animation: none;
    }
    
    .submit-btn::before {
        transition: none;
    }
}

/* ===== HOVER SUPPORT ===== */
@media (hover: hover) {
    .submit-btn:hover:not(:disabled) {
        transform: translateY(-2px);
    }
}