/**
 * Tosbaware Registration Wizard
 * Premium Step-by-Step Registration Experience
 * Uses variables from auth.css - DO NOT redefine them
 */

/* ===== WIZARD CONTAINER ===== */
.auth-container.wizard-mode {
    max-width: 580px;
}

.auth-card.wizard-card {
    padding: 0;
    overflow: hidden;
}

/* ===== PROGRESS BAR ===== */
.wizard-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 32px 20px;
    gap: 0;
    position: relative;
    background: rgba(0, 0, 0, 0.2);
    border-bottom: 1px solid var(--border-subtle);
}

.wizard-progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    cursor: default;
    flex-shrink: 0;
}

.wizard-progress-dot {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    background: var(--bg-input);
    border: 2px solid var(--border-subtle);
    color: var(--text-muted);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.wizard-progress-dot i {
    font-size: 14px;
}

.wizard-progress-step.active .wizard-progress-dot {
    background: var(--primary);
    border-color: var(--primary);
    color: white;
    box-shadow: 0 0 20px var(--primary-glow), 0 0 40px rgba(14, 165, 233, 0.15);
    transform: scale(1.1);
}

.wizard-progress-step.completed .wizard-progress-dot {
    background: var(--success);
    border-color: var(--success);
    color: white;
    box-shadow: 0 0 12px rgba(34, 197, 94, 0.3);
}

.wizard-progress-label {
    font-size: 10px;
    color: var(--text-muted);
    margin-top: 6px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
    transition: color 0.3s ease;
}

.wizard-progress-step.active .wizard-progress-label {
    color: var(--primary);
}

.wizard-progress-step.completed .wizard-progress-label {
    color: var(--success);
}

.wizard-progress-line {
    flex: 1;
    height: 2px;
    background: var(--border-subtle);
    margin: 0 8px;
    margin-bottom: 18px;
    transition: background 0.4s ease;
    min-width: 20px;
}

.wizard-progress-line.completed {
    background: var(--success);
}

/* ===== WIZARD BODY ===== */
.wizard-body {
    padding: 32px;
    position: relative;
    overflow: hidden;
    min-height: 380px;
}

/* ===== STEP CONTAINERS ===== */
.wizard-step {
    display: none;
    animation: wizardFadeIn 0.4s ease-out;
}

.wizard-step.active {
    display: block;
}

@keyframes wizardFadeIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes wizardFadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

/* ===== STEP HEADER ===== */
.wizard-step-header {
    text-align: center;
    margin-bottom: 28px;
}

.wizard-step-header .step-icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    font-size: 24px;
    background: rgba(14, 165, 233, 0.1);
    border: 1px solid rgba(14, 165, 233, 0.2);
    color: var(--primary);
}

.wizard-step-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 6px;
    letter-spacing: -0.02em;
}

.wizard-step-header p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ===== LEGAL DOCUMENT CARDS ===== */
.legal-doc-card {
    background: rgba(17, 24, 39, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    transition: border-color 0.3s ease;
}

.legal-doc-card.approved {
    border-color: rgba(34, 197, 94, 0.4);
}

.legal-doc-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease;
}

.legal-doc-header:hover {
    background: rgba(255, 255, 255, 0.03);
}

.legal-doc-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.legal-doc-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    flex-shrink: 0;
}

.legal-doc-icon.blue {
    background: rgba(14, 165, 233, 0.15);
    color: var(--primary);
}

.legal-doc-icon.purple {
    background: rgba(139, 92, 246, 0.15);
    color: #8b5cf6;
}

.legal-doc-icon.green {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.legal-doc-icon.orange {
    background: rgba(245, 158, 11, 0.15);
    color: var(--warning);
}

.legal-doc-icon.red {
    background: rgba(239, 68, 68, 0.15);
    color: var(--error);
}

.legal-doc-icon.cyan {
    background: rgba(6, 182, 212, 0.15);
    color: #06b6d4;
}

.legal-doc-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.legal-doc-subtitle {
    font-size: 11px;
    color: var(--text-muted);
    margin: 2px 0 0;
}

.legal-doc-toggle {
    font-size: 12px;
    color: var(--text-muted);
    transition: transform 0.3s ease;
}

.legal-doc-card.expanded .legal-doc-toggle {
    transform: rotate(180deg);
}

/* Document Content (Scrollable) */
.legal-doc-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease;
}

.legal-doc-card.expanded .legal-doc-content {
    max-height: 300px;
}

.legal-doc-scroll {
    max-height: 250px;
    overflow-y: auto;
    padding: 0 16px 16px;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text-secondary);
}

.legal-doc-scroll::-webkit-scrollbar {
    width: 4px;
}

.legal-doc-scroll::-webkit-scrollbar-track {
    background: transparent;
}

.legal-doc-scroll::-webkit-scrollbar-thumb {
    background: rgba(14, 165, 233, 0.3);
    border-radius: 2px;
}

.legal-doc-scroll h3 {
    font-size: 13px;
    font-weight: 600;
    color: var(--primary);
    margin: 16px 0 8px;
}

.legal-doc-scroll h3:first-child {
    margin-top: 0;
}

.legal-doc-scroll p {
    margin: 0 0 10px;
}

.legal-doc-scroll ul,
.legal-doc-scroll ol {
    padding-left: 20px;
    margin: 8px 0;
}

.legal-doc-scroll li {
    margin-bottom: 4px;
}

/* Full document link */
.legal-doc-fulllink {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 12px;
    color: var(--primary);
    text-decoration: none;
    border-top: 1px solid var(--border-subtle);
    transition: background 0.2s ease;
}

.legal-doc-fulllink:hover {
    background: rgba(14, 165, 233, 0.05);
    color: var(--accent);
}

/* ===== CONSENT CHECKBOX ===== */
.consent-checkbox {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: rgba(17, 24, 39, 0.4);
    border: 1px solid var(--border-subtle);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
}

.consent-checkbox:hover {
    background: rgba(17, 24, 39, 0.6);
    border-color: rgba(75, 85, 99, 0.6);
}

.consent-checkbox.checked {
    background: rgba(34, 197, 94, 0.08);
    border-color: rgba(34, 197, 94, 0.3);
}

.consent-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--success);
    cursor: pointer;
    flex-shrink: 0;
}

.consent-checkbox .consent-label {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    flex: 1;
}

.consent-checkbox .consent-label strong {
    color: var(--text-primary);
    font-weight: 600;
}

.consent-checkbox .consent-status {
    font-size: 16px;
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s ease;
}

.consent-checkbox.checked .consent-status {
    opacity: 1;
    transform: scale(1);
}

/* ===== NAVIGATION BUTTONS ===== */
.wizard-nav {
    display: flex;
    gap: 12px;
    padding: 20px 32px 24px;
    border-top: 1px solid var(--border-subtle);
}

.wizard-btn {
    flex: 1;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    position: relative;
    overflow: hidden;
}

.wizard-btn-back {
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    color: var(--text-secondary);
    flex: 0 0 auto;
    width: 44px;
    padding: 0;
}

.wizard-btn-back:hover {
    background: var(--bg-elevated);
    color: var(--text-primary);
    border-color: rgba(75, 85, 99, 0.6);
}

.wizard-btn-next {
    background: var(--primary);
    color: white;
}

.wizard-btn-next:hover:not(:disabled) {
    background: var(--primary-hover);
    box-shadow: 0 0 20px -5px var(--primary-glow);
    transform: translateY(-1px);
}

.wizard-btn-next:active:not(:disabled) {
    transform: scale(0.98);
}

.wizard-btn-next:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* Shimmer on next button */
.wizard-btn-next::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
    transition: left 0.5s ease;
}

.wizard-btn-next:hover:not(:disabled)::after {
    left: 100%;
}

.wizard-btn-submit {
    background: linear-gradient(135deg, var(--success), #059669);
    color: white;
}

.wizard-btn-submit:hover:not(:disabled) {
    box-shadow: 0 0 25px rgba(34, 197, 94, 0.4);
    transform: translateY(-1px);
}

.wizard-btn-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.wizard-btn-submit.loading {
    pointer-events: none;
    opacity: 0.8;
}

.wizard-btn-submit.loading::before {
    content: '';
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

/* ===== SUMMARY STEP (Step 5) ===== */
.summary-card {
    background: rgba(17, 24, 39, 0.5);
    border: 1px solid var(--border-subtle);
    border-radius: 12px;
    overflow: hidden;
}

.summary-section {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
}

.summary-section:last-child {
    border-bottom: none;
}

.summary-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 8px;
}

.summary-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px 0;
}

.summary-item-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    flex-shrink: 0;
}

.summary-item-icon.success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
}

.summary-item-text {
    font-size: 13px;
    color: var(--text-secondary);
}

.summary-item-value {
    font-size: 13px;
    color: var(--text-primary);
    font-weight: 500;
    margin-left: auto;
}

/* Marketing consent toggle */
.marketing-toggle {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(139, 92, 246, 0.06);
    border: 1px solid rgba(139, 92, 246, 0.15);
    border-radius: 10px;
    margin-top: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.marketing-toggle:hover {
    background: rgba(139, 92, 246, 0.1);
}

.marketing-toggle input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #8b5cf6;
    cursor: pointer;
}

.marketing-toggle .toggle-text {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
}

.marketing-toggle .toggle-text strong {
    color: #8b5cf6;
}

/* ===== STEP 1: SOCIAL BUTTONS IN WIZARD ===== */
.wizard-social-buttons {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
}

.wizard-social-buttons .btn-social {
    flex: 1;
    height: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.wizard-social-buttons .btn-social:hover {
    background: var(--bg-elevated);
    border-color: rgba(75, 85, 99, 0.6);
}

.wizard-social-buttons .btn-social svg {
    width: 16px;
    height: 16px;
}

/* ===== VALIDATION ERROR IN STEP ===== */
.step-validation-error {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: rgba(239, 68, 68, 0.08);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    color: var(--error);
    animation: wizardFadeIn 0.3s ease;
}

.step-validation-error i {
    font-size: 14px;
    flex-shrink: 0;
}

/* ===== TURNSTILE IN WIZARD ===== */
.wizard-turnstile {
    display: flex;
    justify-content: center;
    margin: 20px 0 8px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 620px) {
    .auth-container.wizard-mode {
        max-width: 100%;
        padding: 12px;
    }

    .wizard-body {
        padding: 24px 20px;
    }

    .wizard-nav {
        padding: 16px 20px 20px;
    }

    .wizard-progress {
        padding: 16px 16px 14px;
        gap: 0;
    }

    .wizard-progress-dot {
        width: 30px;
        height: 30px;
        font-size: 11px;
    }

    .wizard-progress-label {
        font-size: 8px;
    }

    .wizard-progress-line {
        min-width: 12px;
    }

    .wizard-social-buttons {
        flex-direction: column;
    }

    .wizard-step-header .step-icon {
        width: 48px;
        height: 48px;
        font-size: 20px;
    }

    .wizard-step-header h2 {
        font-size: 18px;
    }

    .form-row {
        flex-direction: column;
    }
}

/* ===== SUBTLE PULSE ON ACTIVE DOT ===== */
@keyframes dotPulse {

    0%,
    100% {
        box-shadow: 0 0 20px var(--primary-glow), 0 0 40px rgba(14, 165, 233, 0.15);
    }

    50% {
        box-shadow: 0 0 25px var(--primary-glow), 0 0 50px rgba(14, 165, 233, 0.25);
    }
}

.wizard-progress-step.active .wizard-progress-dot {
    animation: dotPulse 2s ease-in-out infinite;
}

/* ===== TRUST BADGES INSIDE WIZARD ===== */
.wizard-trust-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    padding: 12px 32px 16px;
    font-size: 10px;
}

.wizard-trust-badges .trust-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.wizard-trust-badges .trust-badge svg {
    width: 12px;
    height: 12px;
    color: var(--success);
}