/* ═══════════════════════════════════════════════════════════════
   Onboarding Wizard — Minimalist White Design with Blue Accents
   ═══════════════════════════════════════════════════════════════ */

/* ── Container & Card ── */
.onboarding-container {
    max-width: 560px;
    margin: 0 auto;
    padding: 1.5rem;
}

.onboarding-card {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.onboarding-card-body {
    padding: 2rem 2rem 1.5rem 2rem;
    background: #ffffff;
    position: relative;
    min-height: 280px;
}

.onboarding-card-footer {
    padding: 1rem 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* ── Progress Indicator ── */
.onboarding-progress-wrap {
    margin-bottom: 1.5rem;
}

.onboarding-step-label {
    font-size: 0.8rem;
    color: var(--color-text-medium, #6b7280);
    margin-bottom: 0.5rem;
}

.onboarding-progress-bar {
    height: 4px;
    background: #e9ecef;
    border-radius: 2px;
    overflow: hidden;
    transition: width 300ms ease;
}

.onboarding-progress-fill {
    height: 100%;
    width: 25%;
    background: var(--color-primary, #223976);
    border-radius: 2px;
    transition: width 300ms ease;
}

/* ── Step Content ── */
.wizard-step {
    display: none;
    opacity: 0;
    transform: translateX(50px);
}

.wizard-step.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
}

.wizard-step.step-enter {
    display: block;
    animation: wizardStepEnter 250ms ease-out forwards;
}

.wizard-step.step-exit {
    display: block;
    animation: wizardStepExit 250ms ease-in forwards;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    pointer-events: none;
}

.wizard-step-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-text-dark, #1f2937);
    margin-bottom: 0.5rem;
}

.wizard-step-desc {
    background: #f0f7ff;
    border-left: 4px solid var(--color-accent, #2fbde0);
    padding: 0.75rem 1rem;
    margin-bottom: 1.5rem;
    border-radius: 0 0.5rem 0.5rem 0;
    font-size: 0.875rem;
    color: var(--color-text-medium, #6b7280);
    line-height: 1.4;
}

@keyframes wizardStepEnter {
    from { opacity: 0; transform: translateX(50px); }
    to   { opacity: 1; transform: translateX(0); }
}

@keyframes wizardStepExit {
    from { opacity: 1; transform: translateX(0); }
    to   { opacity: 0; transform: translateX(-50px); }
}

/* ── Form Fields ── */
.wizard-field {
    margin-bottom: 0.25rem;
}

.wizard-field input[type="text"],
.wizard-field input[type="tel"],
.wizard-field input[type="number"],
.wizard-field select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    font-size: 0.95rem;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    background: #ffffff;
    color: var(--color-text-dark, #1f2937);
    transition: border-color 150ms ease, box-shadow 150ms ease;
    outline: none;
}

.wizard-field input:focus,
.wizard-field select:focus {
    border-color: var(--color-primary, #223976);
}

.wizard-field input.field-error,
.wizard-field select.field-error {
    border-color: var(--color-error, #dc3545);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

/* ── Birthday 3-selects ── */
.wizard-birthday-row {
    display: flex;
    gap: 0.75rem;
}

.wizard-birthday-row .wizard-select-group {
    flex: 1;
    min-width: 0;
}

.wizard-birthday-row .wizard-select-group label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-medium, #6b7280);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

/* ── Radio Buttons ── */
.wizard-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.wizard-radio-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    cursor: pointer;
    transition: border-color 150ms ease, background-color 150ms ease;
    min-height: 44px;
}

.wizard-radio-option:hover {
    background: #f8f9fa;
}

.wizard-radio-option.selected {
    border-color: var(--color-primary, #223976);
    background: #f0f4ff;
}

.wizard-radio-option input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--color-primary, #223976);
    cursor: pointer;
    flex-shrink: 0;
}

.wizard-radio-option label {
    cursor: pointer;
    font-size: 0.95rem;
    color: var(--color-text-dark, #1f2937);
    flex: 1;
}

/* ── Phone Country Container ── */
.wizard-phone-container {
    margin-bottom: 0.75rem;
}

/* ── Height Step ── */
.wizard-height-system {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.wizard-height-system .wizard-radio-option {
    flex: 1;
    justify-content: center;
}

.wizard-height-inputs {
    display: flex;
    gap: 0.75rem;
}

.wizard-height-inputs .wizard-height-field {
    flex: 1;
}

.wizard-height-inputs .wizard-height-field label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-medium, #6b7280);
    margin-bottom: 0.25rem;
    text-transform: uppercase;
}

/* ── Buttons ── */
.wizard-btn-back,
.wizard-btn-next,
.wizard-btn-submit {
    padding: 0.625rem 1.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    transition: background-color 150ms ease, opacity 150ms ease;
    min-height: 44px;
}

.wizard-btn-back {
    background: transparent;
    color: var(--color-text-medium, #6b7280) !important;
    border: 1px solid #d1d5db;
}

.wizard-btn-back:hover {
    background: #f3f4f6;
}

.wizard-btn-next {
    background: var(--color-primary, #223976);
    color: #ffffff;
}

.wizard-btn-next:hover {
    background: var(--color-primary-dark, #1a2b5e);
}

.wizard-btn-submit {
    background: var(--color-accent, #2fbde0);
    color: #ffffff;
}

.wizard-btn-submit:hover {
    background: #28a8c8;
}

.wizard-btn-back:disabled,
.wizard-btn-next:disabled,
.wizard-btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wizard-btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

/* ── Error Messages ── */
.wizard-error {
    color: var(--color-error, #dc3545);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0;
    transition: opacity 200ms ease-in;
    min-height: 0;
}

.wizard-error.show {
    opacity: 1;
}

/* Error messages from validarFormulario.js */
.error-message {
    color: var(--color-error, #dc3545);
    font-size: 0.8rem;
    margin-top: 0.5rem;
    opacity: 0;
    animation: fadeInError 200ms ease-in forwards;
}

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

/* ── Success State ── */
.wizard-success {
    text-align: center;
    padding: 2rem 1rem;
}

.wizard-success-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.wizard-success-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--color-primary-dark, #1a2b5e);
    margin-bottom: 0.5rem;
}

.wizard-success-subtitle {
    color: var(--color-text-medium, #6b7280);
}

@keyframes pulseLogo {
    0% { transform: scale(0.8); opacity: 0; }
    50% { transform: scale(1.1); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.wizard-success-logo {
    width: 80px;
    height: auto;
    margin-bottom: 1rem;
    animation: pulseLogo 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

/* ── Reduced Motion ── */
@media (prefers-reduced-motion: reduce) {
    .onboarding-progress-fill,
    .wizard-step,
    .wizard-step.step-enter,
    .wizard-step.step-exit,
    .wizard-field input,
    .wizard-field select,
    .wizard-radio-option,
    .wizard-error {
        transition-duration: 0s !important;
        animation-duration: 0s !important;
    }
}

/* ── Responsive ── */
@media (max-width: 767px) {
    .onboarding-container {
        padding: 0.75rem;
        max-width: 100%;
    }
    .onboarding-card-body {
        padding: 1.5rem 1rem 1rem 1rem;
    }
    .onboarding-card-footer {
        padding: 0.75rem 1rem;
    }
    .wizard-birthday-row {
        gap: 0.5rem;
    }
}

@media (min-width: 1024px) {
    .onboarding-container {
        max-width: 600px;
    }
}

/* ── Focus visible (accessibility) ── */
.wizard-btn-back:focus-visible,
.wizard-btn-next:focus-visible,
.wizard-btn-submit:focus-visible,
.wizard-radio-option input:focus-visible + label {
    outline: 2px solid var(--color-primary, #223976);
    outline-offset: 2px;
}
