/**
 * Step Form CSS - Estilos para formulario de contacto por pasos
 * Integrado con variables del tema
 */

/* ====================
   ESTRUCTURA BASE
==================== */

#step-form-container {
    font-family: var(--font-family);
    background: transparent;
    border: none;
    color: var(--color-texto);
    padding: 0;
    margin: 0;
    box-shadow: none;
}

/* ====================
   BARRA DE PROGRESO
==================== */

.step-indicator {
    display: none;
}

.step-indicator:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    left: 50%;
    width: calc(100% + 2rem);
    height: 2px;
    background: #e2e8f0;
    z-index: -1;
}

.step-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #e2e8f0;
    border: 3px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 8px;
    transition: all 0.3s ease;
    position: relative;
    z-index: 3;
}

.step-circle.active {
    background: #bdd8eb;
    border-color: #bdd8eb;
    box-shadow: 0 0 0 4px rgba(189, 216, 235, 0.2);
    transform: scale(1.1);
}

.step-circle.completed {
    background: #10b981;
    border-color: #10b981;
}

.step-circle.completed .step-icon::after {
    content: '✓';
    position: absolute;
    color: white;
    font-weight: bold;
    font-size: 14px;
}

.step-icon {
    font-size: 16px;
    position: relative;
}

.step-circle.active .step-icon,
.step-circle.completed .step-icon {
    color: white;
}

.step-label {
    font-size: 12px;
    font-weight: 500;
    color: #64748b;
    text-align: center;
    transition: color 0.3s ease;
}

.step-indicator[data-step="1"] .step-circle.active ~ .step-label,
.step-indicator[data-step="2"] .step-circle.active ~ .step-label,
.step-indicator[data-step="3"] .step-circle.active ~ .step-label {
    color: #bdd8eb;
    font-weight: 600;
}

.progress-bar {
    display: none;
}

/* ====================
   SELECTORES PERSONALIZADOS
==================== */

.custom-select-container {
    position: relative;
    margin-bottom: 1rem;
    z-index: 1000;
}

.custom-select-container.active {
    z-index: 100000;
}

.custom-select-display {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: #3a3838;
    border: 1px solid rgba(189, 216, 235, 0.4);
    border-radius: 8px;
    cursor: pointer;
    min-height: 50px;
}

.custom-select-display:hover {
    border-color: rgba(189, 216, 235, 0.6);
    background: #404040;
}

.custom-select-display.active {
    border-color: var(--color-titulo, #bdd8eb);
    background: #404040;
}

.custom-select-placeholder {
    color: rgba(255, 255, 255, 0.8);
    font-size: 15px;
    font-weight: 400;
}

.custom-select-selected {
    display: flex;
    align-items: center;
    color: #ffffff;
    font-size: 15px;
    font-weight: 500;
}

.custom-select-arrow {
    margin-left: auto;
    color: rgba(255, 255, 255, 0.7);
}

.custom-select-options {
    position: relative;
    background: #1a1a1a;
    border: 2px solid var(--color-titulo, #bdd8eb);
    border-radius: 8px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
    z-index: 99999;
    max-height: 300px;
    overflow-y: auto;
    display: none;
    margin-top: 4px;
}

.custom-select-display.active + .custom-select-options {
    display: block !important;
}

.custom-select-option {
    display: flex;
    align-items: center;
    padding: 16px 18px;
    cursor: pointer;
    border-bottom: 1px solid rgba(189, 216, 235, 0.2);
    background-color: #1a1a1a;
    color: #ffffff;
    min-height: 60px;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.custom-select-option:last-child {
    border-bottom: none;
}

.custom-select-option:hover {
    background-color: var(--color-titulo, #bdd8eb) !important;
    color: #1a1a1a !important;
}

.custom-select-option.selected {
    background-color: var(--color-titulo, #bdd8eb) !important;
    color: #1a1a1a !important;
}

.custom-select-option * {
    pointer-events: none;
}

/* Opción con texto simple (lugares) */
.option-with-icon {
    display: flex;
    align-items: center;
    gap: 12px;
}

.option-text {
    font-size: 15px;
    color: #ffffff;
    font-weight: 500;
}

.custom-select-option:hover .option-text {
    color: #1a1a1a !important;
}

.custom-select-option.selected .option-text {
    color: #1a1a1a !important;
}

/* Opción con imagen (viajes) */
.option-with-image {
    display: flex;
    align-items: center;
    gap: 16px;
}

.option-image {
    width: 60px;
    height: 40px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}

.option-content {
    flex: 1;
}

.option-title {
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.option-subtitle {
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
    margin: 2px 0 0 0;
}

.custom-select-option:hover .option-title {
    color: #1a1a1a !important;
}

.custom-select-option:hover .option-subtitle {
    color: rgba(26, 26, 26, 0.7) !important;
}

.custom-select-option.selected .option-title {
    color: #1a1a1a !important;
}

.custom-select-option.selected .option-subtitle {
    color: rgba(26, 26, 26, 0.7) !important;
}

/* Responsive */
@media (max-width: 768px) {
    .custom-select-display {
        padding: 10px 14px;
        min-height: 44px;
    }
    
    .custom-select-option {
        padding: 10px 14px;
    }
    
    .option-image {
        width: 50px;
        height: 32px;
    }
    
    .option-with-image {
        gap: 12px;
    }
}

/* Icono de interrogación */
.question-icon-container {
    width: 60px;
    height: 40px;
    background: rgba(189, 216, 235, 0.1);
    border: 2px dashed rgba(189, 216, 235, 0.3);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
}

.question-icon {
    width: 24px;
    height: 24px;
    color: var(--color-titulo, #bdd8eb);
    transition: color 0.3s ease;
}

/* Hover para la opción "no tengo claro" */
.custom-select-option:hover .question-icon-container {
    background: rgba(26, 26, 26, 0.1) !important;
    border-color: rgba(26, 26, 26, 0.4) !important;
}

.custom-select-option:hover .question-icon {
    color: #1a1a1a !important;
}

/* Responsive para icono de interrogación */
@media (max-width: 768px) {
    .question-icon-container {
        width: 50px;
        height: 32px;
    }
    
    .question-icon {
        width: 20px;
        height: 20px;
    }
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #bdd8eb 0%, #10b981 100%);
    border-radius: 2px;
    transition: width 0.5s ease;
    position: relative;
}

.progress-fill::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.3) 50%, transparent 100%);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ====================
   CONTENIDO DE PASOS
==================== */

.step-content {
    display: none;
    opacity: 0;
    transform: translateX(20px);
    transition: all 0.3s ease;
}

.step-content.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.step-content h3 {
    color: #bdd8eb;
    padding-bottom: 1rem;
    margin-bottom: 2rem;
    position: relative;
}

.step-form-wrapper {
    width: 100%;
    max-width: 100%;
}

/* Asegurar mismo ancho y márgenes para header-block y form-container-wrapper */
.header-block,
.form-container-wrapper {
    max-width: 672px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    width: 100%;
}

/* ====================
   CAMPOS DE FORMULARIO
==================== */

.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #bdd8eb;
    margin-bottom: 6px;
}

.form-label.required::after {
    content: ' *';
    color: #ef4444;
    font-weight: 600;
}

.form-input {
    width: 100%;
    padding: 16px 12px;
    border: none;
    border-bottom: 1px solid #e5e7eb;
    border-radius: 10px;
    font-size: 16px;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
    background: rgba(189, 216, 235, 0.1);
    color: #bdd8eb;
}

.form-input:focus {
    outline: none;
    border-bottom-color: #bdd8eb;
    box-shadow: none;
}

.form-input:hover {
    border-bottom-color: #9ca3af;
}

.form-input.error {
    border-bottom-color: #ef4444;
    box-shadow: none;
}

.form-input::placeholder {
    color: #bdd8eb;
    font-style: italic;
}

/* Select personalizado */
select.form-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%236b7280' d='M6 8L2 4h8z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    appearance: none;
    padding-right: 40px;
}

/* Opciones del select */
select.form-input option {
    background: rgba(189, 216, 235, 0.1);
    color: #1a1a1a;
    padding: 8px 12px;
}

/* Textarea */
textarea.form-input {
    resize: vertical;
    min-height: 100px;
}

/* ====================
   RADIO Y CHECKBOX
==================== */

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.radio-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #bdd8eb;
    transition: color 0.2s ease;
    padding: 8px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.radio-label:hover {
    background: rgba(189, 216, 235, 0.2);
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 50%;
    margin-right: 10px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #bdd8eb;
    background: #bdd8eb;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 6px;
    height: 6px;
    background: white;
    border-radius: 50%;
    transform: translate(-50%, -50%);
}

/* Checkbox personalizado */
.checkbox-label {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
    font-size: 14px;
    color: #bdd8eb;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 2px solid #d1d5db;
    border-radius: 4px;
    margin-right: 10px;
    position: relative;
    transition: all 0.2s ease;
    flex-shrink: 0;
    margin-top: 2px;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    border-color: #bdd8eb;
    background: #bdd8eb;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    color: white;
    font-size: 12px;
    font-weight: bold;
    transform: translate(-50%, -50%);
}

/* ====================
   MENSAJES DE ERROR
==================== */

.error-message {
    display: block;
    color: #ef4444;
    font-size: 12px;
    margin: 4px 0 0 0;
    padding: 0;
    font-weight: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.error-message:not(:empty) {
    opacity: 1;
}

.form-input.error,
.form-input.border-red-500 {
    border-bottom-color: #ef4444 !important;
    box-shadow: none !important;
    padding: 16px 12px !important; /* Mantener el padding original */
    height: auto !important; /* Mantener altura original */
}

.form-input.error:focus,
.form-input.border-red-500:focus {
    box-shadow: none !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ====================
   BOTONES
==================== */

.btn-primary,
.btn-secondary,
.btn-success {
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 500;
    font-family: var(--font-family);
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 120px;
}

.btn-primary {
    background: var(--color-titulo);
    color: var(--color-fondo);
    box-shadow: 0 2px 4px rgba(189, 216, 235, 0.2);
}

.btn-primary:hover {
    background: var(--color-accent);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(189, 216, 235, 0.3);
}

.btn-secondary {
    background: rgba(189, 216, 235, 0.3);
    color: var(--color-texto);
    box-shadow: 0 2px 4px rgba(189, 216, 235, 0.1);
}

.btn-secondary:hover {
    background: rgba(189, 216, 235, 0.4);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(189, 216, 235, 0.2);
}

.btn-success {
    background: var(--color-accent);
    color: var(--color-fondo);
    box-shadow: 0 2px 4px rgba(168, 192, 209, 0.2);
}

.btn-success:hover {
    background: var(--color-titulo);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(168, 192, 209, 0.3);
}

.btn-primary:disabled,
.btn-secondary:disabled,
.btn-success:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* ====================
   MENSAJE DE ÉXITO
==================== */

#form-success {
    background: linear-gradient(135deg, rgba(189, 216, 235, 0.1) 0%, rgba(168, 192, 209, 0.1) 100%);
    border: 2px solid var(--color-accent);
    animation: slideInUp 0.5s ease;
    color: var(--color-texto);
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ====================
   BACKGROUND MÓVIL
==================== */

.mobile-background-container {
    pointer-events: none;
}

.mobile-step-background {
    background-attachment: fixed;
    background-repeat: no-repeat;
    filter: blur(1px);
    transform: scale(1.1);
}

/* Overlay para mejorar legibilidad en mobile */
.mobile-step-background::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(
        180deg, 
        rgba(26, 26, 26, 0.7) 0%, 
        rgba(26, 26, 26, 0.5) 40%, 
        rgba(26, 26, 26, 0.3) 60%, 
        rgba(26, 26, 26, 0.6) 100%
    );
    z-index: 1;
}

/* Asegurar que el contenido esté por encima del background */
.form-container-wrapper,
.header-block {
    position: relative;
    z-index: 10;
}

/* ====================
   RESPONSIVE
==================== */

@media (max-width: 768px) {
    #step-form-container {
        padding: 1rem;
        background: rgba(26, 26, 26, 0.85);
        backdrop-filter: blur(8px);
        border-radius: 16px;
        margin: 1rem;
        border: 1px solid rgba(189, 216, 235, 0.2);
    }
    
    .header-block,
    .form-container-wrapper {
        margin-bottom: 0px;
        width: 100%;
        max-width: 672px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    .header-block {
        background: transparent;
        backdrop-filter: none;
        border-radius: 0;
        padding: 1.5rem;
        margin-bottom: 2rem;
        border: none;
        text-align: center;
    }
    
    .step-indicator {
        flex-direction: column;
        margin-bottom: 1rem;
    }
    
    .step-label {
        font-size: 11px;
        text-align: center;
    }
    
    .step-indicator:not(:last-child)::after {
        display: none;
    }
    
    .radio-group {
        gap: 10px;
    }
    
    .form-input {
        padding: 12px 8px;
        font-size: 16px; /* Evitar zoom en iOS */
    }
    
    .form-group {
        margin-bottom: 1.25rem;
    }
    
    .radio-label {
        padding: 6px;
        font-size: 14px;
    }
    
    .btn-primary,
    .btn-secondary,
    .btn-success {
        width: 100%;
        justify-content: center;
        margin: 0.5rem 0;
        padding: 10px 20px;
    }
}

@media (max-width: 480px) {
    #step-form-container {
        
        padding: 0.75rem;
    }
    
    .header-block,
    .form-container-wrapper {
        margin-bottom: 0px;
        width: 100%;
        max-width: 672px !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }
    
    
    .step-circle {
        width: 35px;
        height: 35px;
    }
    
    .step-icon {
        font-size: 14px;
    }
    
    .progress-bar {
        height: 3px;
    }
    
    .step-content h3 {
        font-size: 1.25rem;
        margin-bottom: 1.5rem;
    }
    
    .form-input {
        padding: 10px 6px;
        font-size: 16px;
    }
    
    .form-group {
        margin-bottom: 1rem;
    }
    
    .form-label {
        font-size: 13px;
        margin-bottom: 4px;
    }
    
    .radio-label {
        padding: 4px;
        font-size: 13px;
    }
    
    .radio-custom,
    .checkbox-custom {
        width: 16px;
        height: 16px;
        margin-right: 8px;
    }
    
    textarea.form-input {
        min-height: 80px;
    }
}

/* ====================
   ANIMACIONES ADICIONALES
==================== */

.form-group {
    animation: fadeInUp 0.5s ease;
    animation-fill-mode: both;
}

.form-group:nth-child(1) { animation-delay: 0.1s; }
.form-group:nth-child(2) { animation-delay: 0.2s; }
.form-group:nth-child(3) { animation-delay: 0.3s; }
.form-group:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Estados de loading */
.loading {
    position: relative;
    overflow: hidden;
}

.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.4), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% { left: -100%; }
    100% { left: 100%; }
}

/* ====================
   INTEGRACIÓN TEMA
==================== */

/* Asegurar que todos los elementos usen las variables del tema */
#step-form-container *,
.step-form * {
    font-family: var(--font-family) !important;
}

/* Links dentro del formulario */
#step-form-container a {
    color: var(--color-titulo);
    transition: color 0.3s ease;
}

#step-form-container a:hover {
    color: var(--color-accent);
}

/* Mensajes de error */
.error-message {
    color: #ef4444;
    font-family: var(--font-family);
}

/* Selects personalizados */
select.form-input {
    background-image: url("data:image/svg+xml;charset=UTF-8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'><path fill='%23bdd8eb' d='M6 8L2 4h8z'/></svg>");
}

/* Estados focus mejorados */
.form-input:focus {
    border-bottom-color: var(--color-titulo) !important;
    box-shadow: none !important;
}

/* Responsive específico del tema */
@media (max-width: 768px) {
    #step-form-container {
        background: rgba(189, 216, 235, 0.05);
        border: 1px solid rgba(189, 216, 235, 0.15);
    }
    
    .step-circle {
        background: rgba(189, 216, 235, 0.08);
        border-color: rgba(189, 216, 235, 0.25);
    }
    
    .step-circle.active {
        background: var(--color-titulo);
        border-color: var(--color-titulo);
    }
}
