/**
 * Estilos para el Onboarding - Configuración Inicial
 */

/* Prevenir selección de texto en onboarding */
.onboarding-container *,
.onboarding-overlay * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
}

/* Permitir selección solo en inputs */
.onboarding-container input,
.onboarding-container textarea,
.onboarding-overlay input,
.onboarding-overlay textarea {
    -webkit-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

.onboarding-body {
    margin: 0;
    padding: 0;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark, #1e40af) 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

.onboarding-container {
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
    animation: fadeInUp 0.6s ease-out;
}

/* Indicador de progreso */
.onboarding-progress {
    margin-bottom: 60px;
}

.progress-bar {
    width: 100%;
    height: 4px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 30px;
}

.progress-fill {
    height: 100%;
    background: var(--primary-foreground, #ffffff);
    border-radius: 2px;
    transition: width 0.4s ease;
    width: 33.33%;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
}

.progress-steps::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    right: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.2);
    z-index: 0;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 1;
    flex: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 16px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.step-indicator.active .step-number {
    background: var(--primary-foreground, #ffffff);
    color: var(--primary);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.step-indicator.completed .step-number {
    background: var(--primary-foreground, #ffffff);
    color: var(--primary);
}

.step-label {
    margin-top: 8px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    font-weight: 500;
    text-align: center;
    transition: color 0.3s ease;
}

.step-indicator.active .step-label {
    color: var(--primary-foreground, #ffffff);
    font-weight: 600;
}

/* Contenido de los pasos */
.onboarding-content {
    background: var(--background, #ffffff);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.onboarding-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary) 0%, var(--primary-dark, #1e40af) 100%);
}

.onboarding-step {
    display: none;
    animation: slideInRight 0.4s ease-out;
}

.onboarding-step.active {
    display: block;
    animation: slideInRight 0.4s ease-out;
}

.onboarding-step.slide-out {
    animation: slideOutLeft 0.3s ease-in;
}

.step-icon-wrapper {
    text-align: center;
    margin-bottom: 32px;
    margin-top: 20px;
}

.step-icon {
    width: 80px;
    height: 80px;
    color: var(--primary);
    animation: scaleIn 0.5s ease-out;
}

.step-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--foreground);
    text-align: center;
    margin-bottom: 12px;
    animation: fadeInUp 0.5s ease-out 0.1s both;
}

.step-description {
    font-size: 16px;
    color: var(--muted-foreground, #6b7280);
    text-align: center;
    margin-bottom: 32px;
    animation: fadeInUp 0.5s ease-out 0.2s both;
}

/* Formulario */
.form-group {
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease-out 0.3s both;
}

.form-label {
    display: flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--foreground);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border, #e5e7eb);
    border-radius: 10px;
    font-size: 16px;
    transition: all 0.3s ease;
    background: var(--background);
    color: var(--foreground);
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb, 59, 130, 246), 0.1);
}

.form-input::placeholder {
    color: var(--muted-foreground, #9ca3af);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.form-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted-foreground, #6b7280);
}

.input-error {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--destructive, #ef4444);
    min-height: 18px;
}

/* Password input wrapper */
.password-input-wrapper {
    position: relative;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--muted-foreground, #6b7280);
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.password-toggle:hover {
    color: var(--foreground);
}

.password-icon {
    width: 18px;
    height: 18px;
}

/* Botones */
.step-actions {
    display: flex;
    gap: 12px;
    margin-top: 32px;
}

.btn {
    flex: 1;
    padding: 14px 24px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--primary-foreground);
    box-shadow: 0 4px 12px rgba(var(--primary-rgb, 59, 130, 246), 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--primary-rgb, 59, 130, 246), 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--secondary, #f3f4f6);
    color: var(--foreground);
}

.btn-secondary:hover {
    background: var(--secondary-hover, #e5e7eb);
}

.btn-next,
.btn-submit {
    animation: fadeInUp 0.5s ease-out 0.4s both;
}

.btn-prev {
    animation: fadeInUp 0.5s ease-out 0.4s both;
}

/* Animaciones */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutLeft {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-30px);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive */
@media (max-width: 640px) {
    .onboarding-container {
        padding: 15px;
    }

    .onboarding-content {
        padding: 30px 20px;
        border-radius: 16px;
    }

    .step-title {
        font-size: 24px;
    }

    .step-description {
        font-size: 14px;
    }

    .step-icon {
        width: 60px;
        height: 60px;
    }

    .step-number {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .step-label {
        font-size: 11px;
    }

    .step-actions {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* Estados de carga */
.btn-submit.loading {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

.btn-submit.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    margin-left: 8px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
