/* Reset y configuración base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Instrument Sans, sans-serif;
    color: #333;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Container principal 1 */
.form-container {
    background: white;
    border-radius: 24px;
    padding: 60px;
    max-width: 1000px;
    width: 100%;
    min-height: 600px;
    position: relative;
}

/* Indicador de pasos */
.step-indicator {
    display: flex;
    justify-content: space-between;
    margin-bottom: 60px;
    position: relative;
    padding-bottom: 8px;
}

.step {
    flex: 1;
    text-align: center;
    position: relative;
    color: #999;
    font-weight: 500;
    font-size: 16px;
    transition: color 0.3s ease;
}

.step.active {
    color: #333;
}

.step.completed {
    color: #999;
}

.step-line {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    height: 2px;
    background: #e5e5e5;
    z-index: 1;
}

.step-line-progress {
    height: 100%;
    background: #8B7CF6;
    transition: width 0.4s ease;
    width: 0%;
}

.step::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    right: 0;
    height: 2px;
    background: #e5e5e5;
    z-index: 2;
}

.step.active::after {
    background: #8B7CF6;
}

/* Pasos del formulario */
.form-step {
    display: none;
    animation: fadeIn 0.3s ease-in-out;
}

.form-step.active {
    display: block;
}

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

/* Títulos y subtítulos */
.step-title {
    font-size: 48px;
    font-weight: bold;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.1;
}

.step-subtitle {
    color: #999;
    font-size: 16px;
    margin-bottom: 40px;
    line-height: 1.5;
}

/* Grid del formulario */
.form-grid {
    display: grid;
    gap: 20px;
    margin-bottom: 40px;
}

.form-grid.two-col {
    grid-template-columns: 1fr 1fr;
}

.form-grid.three-col {
    grid-template-columns: 1fr 1fr 1fr;
}

.form-group {
    position: relative;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

/* Inputs y selects */
input, select {
    width: 100%;
    padding: 20px 24px;
    border: 2px solid transparent;
    border-radius: 16px;
    font-size: 16px;
    background: #f8f8f8;
    transition: all 0.3s ease;
    appearance: none;
    font-family: inherit;
}

input:focus, select:focus {
    outline: none;
    border-color: #8B7CF6;
    background: white;
    box-shadow: 0 0 0 3px rgba(139, 124, 246, 0.1);
}

input::placeholder {
    color: #999;
}

/* Select personalizado */
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 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 20px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 56px;
    cursor: pointer;
}

/* Redes sociales */
.social-network {
    background: #f8f8f8;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    position: relative;
    transition: all 0.3s ease;
}

.social-network:hover {
    background: #f0f0f0;
}

.remove-social {
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff4757;
    color: white;
    border: none;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    z-index: 10;
    font-weight: bold;
    line-height: 1;
}

.remove-social:hover {
    background: #ff3742;
    transform: scale(1.1);
    z-index: 15;
}

/* Asegurar que el botón eliminar esté por encima de los selects */
.social-network .form-grid {
    padding-right: 50px; /* Dar espacio al botón eliminar */
}

/* Solo mostrar botón eliminar en redes sociales adicionales */
.social-network[data-index="0"] .remove-social {
    display: none;
}

/* Grid de intereses */
.interests-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.interest-tag {
    background: #f8f8f8;
    border: 2px solid transparent;
    border-radius: 50px;
    padding: 16px 24px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
    text-align: center;
}

.interest-tag:hover {
    background: #f0f0f0;
    transform: translateY(-2px);
}

.interest-tag.selected {
    background: #B8E6B8;
    border-color: #4CAF50;
    color: #2E7D32;
}

.interest-tag:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.interests-counter {
    text-align: center;
    color: #666;
    font-size: 14px;
    margin-bottom: 40px;
}

/* Botones */
.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 140px;
}

.btn-primary {
    background: #000;
    color: white;
}

.btn-primary:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.btn-secondary {
    background: #8B7CF6;
    color: white;
    margin-bottom: 40px;
}

.btn-secondary:hover {
    background: #7C6AE8;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(139, 124, 246, 0.3);
}

.btn-ghost {
    background: #e5e5e5;
    color: #666;
}

.btn-ghost:hover {
    background: #d0d0d0;
    color: #333;
}

/* Acciones del formulario */
.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.form-actions.center {
    justify-content: center;
}

/* Solo centrar botón "siguiente" cuando es el único botón en pasos 1-4 */
.form-actions .btn:only-child:not(.btn-final) {
    margin-left: auto;
}

/* El botón final siempre centrado */
.form-actions .btn-final {
    margin: 0 auto;
}

/* Mensaje de éxito */
.success-message {
    text-align: center;
    padding: 40px 0;
}

.success-message .step-title {
    margin-bottom: 30px;
}

/* Step 5 - Página de confirmación */
.form-container.step-5 .form-step[data-step="5"] {
    background: #EEEFFF;
    margin: -60px;
    padding: 80px 60px;
    border-radius: 24px;
    min-height: 600px;
    display: flex !important;
    align-items: center;
    justify-content: center;
}

/* Asegurar que otros pasos no tengan el fondo especial */
.form-step[data-step="1"],
.form-step[data-step="2"], 
.form-step[data-step="3"],
.form-step[data-step="4"] {
    background: transparent;
    margin: 0;
    padding: 0;
    min-height: auto;
    display: block;
    align-items: initial;
    justify-content: initial;
}

/* Ocultar step indicator en el paso 5 */
.form-container.step-5 .step-indicator {
    display: none;
}

/* Botón especial para el paso final */
.btn-final {
    background: #A1A9FF !important;
    color: white;
    padding: 18px 40px;
    font-size: 16px;
    font-weight: 600;
}

.btn-final:hover {
    background: #8B7CF6 !important;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(161, 169, 255, 0.3);
}

/* Validación */
.form-group.error input,
.form-group.error select {
    border-color: #ff4757;
    background: #fff5f5;
}

.error-message {
    color: #ff4757;
    font-size: 14px;
    margin-top: 8px;
    display: none;
}

.form-group.error .error-message {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .form-container {
        padding: 40px 30px;
        margin: 10px;
        border-radius: 16px;
    }
    
    .step-title {
        font-size: 36px;
    }
    
    .form-grid.two-col,
    .form-grid.three-col {
        grid-template-columns: 1fr;
    }
    
    .step-indicator {
        margin-bottom: 40px;
    }
    
    .step {
        font-size: 14px;
    }
    
    .interests-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column-reverse;
        gap: 12px;
    }
    
    .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .form-container {
        padding: 30px 20px;
    }
    
    .step-title {
        font-size: 28px;
    }
    
    input, select {
        padding: 16px 20px;
        font-size: 15px;
    }
    
    .social-network {
        padding: 16px;
    }
}

/* Estados de carga */
.loading {
    opacity: 0.7;
    pointer-events: none;
}

.btn.loading {
    position: relative;
    color: transparent;
}

.btn.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}