/* ============================================================================
   Dereal Onboarding Wizard
   ============================================================================ */

/* Enable scrolling */
body.onboarding-page {
    overflow-y: auto !important;
    overflow-x: hidden;
    height: auto;
    min-height: 100vh;
    margin: 0;
}

/* Wizard wrapper */
.onboarding-wizard {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, #0d0d14 0%, #1a1a2e 50%, #0d0d14 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    overflow-y: auto;
}

/* Container */
.onboarding-container {
    max-width: 640px;
    width: 100%;
    background: rgba(30, 30, 45, 0.95);
    border-radius: 20px;
    padding: 40px;
    border: 1px solid rgba(200, 180, 140, 0.15);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    position: relative;
    overflow: hidden;
}

/* ============================================================================
   Step Transitions
   ============================================================================ */

.onboarding-step {
    display: none;
    opacity: 0;
    transform: translateX(0);
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.onboarding-step.active {
    display: block;
    opacity: 1;
    transform: translateX(0);
    animation: fadeSlideIn 0.4s ease forwards;
}

.onboarding-step.exit-left {
    display: block;
    animation: fadeSlideOutLeft 0.35s ease forwards;
    position: absolute;
    top: 40px;
    left: 40px;
    right: 40px;
}

.onboarding-step.exit-right {
    display: block;
    animation: fadeSlideOutRight 0.35s ease forwards;
    position: absolute;
    top: 40px;
    left: 40px;
    right: 40px;
}

.onboarding-step.enter-right {
    transform: translateX(40px);
    opacity: 0;
}

.onboarding-step.enter-left {
    transform: translateX(-40px);
    opacity: 0;
}

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

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

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

/* ============================================================================
   Header
   ============================================================================ */

.onboarding-header {
    text-align: center;
    margin-bottom: 30px;
}

.onboarding-logo {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
    color: #c8b48c;
    animation: logoPulse 3s ease-in-out infinite;
}

@keyframes logoPulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50%      { transform: scale(1.06); opacity: 1; }
}

.onboarding-header h1 {
    font-family: 'Crimson Pro', serif;
    font-size: 2.4rem;
    font-weight: 300;
    color: #f5f5f5;
    margin: 0 0 10px;
    letter-spacing: 0.04em;
}

.onboarding-header h2 {
    font-family: 'Crimson Pro', serif;
    font-size: 1.8rem;
    font-weight: 400;
    color: #f5f5f5;
    margin: 0 0 10px;
}

.onboarding-tagline {
    color: #c8b48c;
    font-size: 1.1rem;
    margin: 0;
    font-style: italic;
}

.onboarding-subtitle {
    color: #a0a0a0;
    font-size: 1rem;
    margin: 0;
}

/* ============================================================================
   Content
   ============================================================================ */

.onboarding-content {
    margin-bottom: 30px;
}

.welcome-intro {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #d0d0d0;
    text-align: center;
    margin-bottom: 30px;
}

/* ============================================================================
   Welcome Principles (Step 1)
   ============================================================================ */

.welcome-principles {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.principle {
    text-align: center;
    padding: 22px 14px;
    background: rgba(200, 180, 140, 0.04);
    border-radius: 14px;
    border: 1px solid rgba(200, 180, 140, 0.08);
    transition: border-color 0.3s, background 0.3s;
}

.principle:hover {
    border-color: rgba(200, 180, 140, 0.2);
    background: rgba(200, 180, 140, 0.07);
}

.principle-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
}

.principle-icon svg {
    display: block;
}

.principle h3 {
    font-size: 0.95rem;
    color: #f5f5f5;
    margin: 0 0 8px;
    font-weight: 500;
}

.principle p {
    font-size: 0.83rem;
    color: #a0a0a0;
    margin: 0;
    line-height: 1.45;
}

/* ============================================================================
   Companions Grid (Step 2)
   ============================================================================ */

.companions-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-bottom: 18px;
}

.companion-card {
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(200, 180, 140, 0.04);
    border: 1.5px solid rgba(200, 180, 140, 0.1);
    border-radius: 14px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.25s ease;
    color: #a0a0a0;
}

.companion-card:hover {
    border-color: rgba(200, 180, 140, 0.25);
    background: rgba(200, 180, 140, 0.07);
    transform: translateY(-1px);
}

.companion-card.selected {
    border-color: #c8b48c;
    background: rgba(200, 180, 140, 0.12);
    color: #c8b48c;
    box-shadow: 0 0 20px rgba(200, 180, 140, 0.1);
}

.companion-card-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.companion-card-icon svg {
    display: block;
}

.companion-card-text {
    flex: 1;
    min-width: 0;
}

.companion-card-text h3 {
    font-size: 1rem;
    color: #f5f5f5;
    margin: 0 0 2px;
    font-weight: 500;
}

.companion-card-text .companion-card-role {
    font-size: 0.8rem;
    color: #c8b48c;
    display: block;
    margin-bottom: 4px;
}

.companion-card-text p {
    font-size: 0.82rem;
    color: #888;
    margin: 0;
    line-height: 1.4;
}

.companion-card.selected .companion-card-text p {
    color: #b0a080;
}

.companions-tip {
    text-align: center;
    font-size: 0.88rem;
    color: rgba(200, 180, 140, 0.7);
    padding: 10px 15px;
    margin: 0;
}

/* ============================================================================
   How It Works Cards (Step 3)
   ============================================================================ */

.how-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 18px;
}

.how-card {
    text-align: center;
    padding: 28px 16px 24px;
    background: rgba(200, 180, 140, 0.04);
    border-radius: 16px;
    border: 1px solid rgba(200, 180, 140, 0.08);
    transition: border-color 0.3s, transform 0.3s;
}

.how-card:hover {
    border-color: rgba(200, 180, 140, 0.2);
    transform: translateY(-2px);
}

.how-card-icon {
    margin-bottom: 16px;
    display: flex;
    justify-content: center;
}

.how-card h3 {
    font-size: 1rem;
    color: #f5f5f5;
    margin: 0 0 10px;
    font-weight: 500;
}

.how-card p {
    font-size: 0.85rem;
    color: #a0a0a0;
    margin: 0;
    line-height: 1.5;
}

/* ============================================================================
   Mini-Assessment (Step 4)
   ============================================================================ */

.mini-assessment {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.assessment-question {
    /* Each question block */
}

.assessment-label {
    display: block;
    font-size: 1rem;
    color: #e0e0e0;
    margin-bottom: 10px;
    font-weight: 500;
}

.assessment-hint {
    font-size: 0.82rem;
    color: #707070;
    margin: -4px 0 10px;
}

/* Feeling buttons */
.feeling-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.feeling-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 18px;
    background: rgba(200, 180, 140, 0.04);
    border: 1.5px solid rgba(200, 180, 140, 0.12);
    border-radius: 12px;
    color: #a0a0a0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.85rem;
    flex: 1;
    min-width: 70px;
}

.feeling-btn:hover {
    border-color: rgba(200, 180, 140, 0.3);
    background: rgba(200, 180, 140, 0.08);
}

.feeling-btn.selected {
    border-color: #c8b48c;
    background: rgba(200, 180, 140, 0.14);
    color: #c8b48c;
}

.feeling-emoji svg {
    display: block;
}

/* Interest buttons (tags) */
.interest-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.interest-btn {
    padding: 8px 18px;
    background: rgba(200, 180, 140, 0.04);
    border: 1.5px solid rgba(200, 180, 140, 0.12);
    border-radius: 20px;
    color: #a0a0a0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.88rem;
}

.interest-btn:hover {
    border-color: rgba(200, 180, 140, 0.3);
}

.interest-btn.selected {
    border-color: #c8b48c;
    background: rgba(200, 180, 140, 0.14);
    color: #c8b48c;
}

/* Communication preference */
.comm-options {
    display: flex;
    gap: 12px;
}

.comm-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 18px 22px;
    background: rgba(200, 180, 140, 0.04);
    border: 1.5px solid rgba(200, 180, 140, 0.12);
    border-radius: 14px;
    color: #a0a0a0;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.88rem;
    flex: 1;
}

.comm-btn:hover {
    border-color: rgba(200, 180, 140, 0.3);
    background: rgba(200, 180, 140, 0.08);
}

.comm-btn.selected {
    border-color: #c8b48c;
    background: rgba(200, 180, 140, 0.14);
    color: #c8b48c;
}

.comm-btn svg {
    display: block;
}

/* ============================================================================
   Consent Gates (Step 4)
   ============================================================================ */

.consent-section {
    display: flex;
    flex-direction: column;
    gap: 28px;
}

.consent-question {
    /* question block */
}

.consent-label {
    display: block;
    font-size: 1rem;
    color: #e0e0e0;
    margin-bottom: 4px;
    font-weight: 500;
}

.consent-desc {
    font-size: 0.85rem;
    color: #808080;
    margin: 0 0 12px;
}

.consent-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.consent-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: rgba(200, 180, 140, 0.04);
    border: 1.5px solid rgba(200, 180, 140, 0.12);
    border-radius: 12px;
    color: #a0a0a0;
    cursor: pointer;
    transition: all 0.2s;
    text-align: left;
    width: 100%;
}

.consent-btn:hover {
    border-color: rgba(200, 180, 140, 0.3);
    background: rgba(200, 180, 140, 0.08);
}

.consent-btn.selected {
    border-color: #c8b48c;
    background: rgba(200, 180, 140, 0.12);
    color: #c8b48c;
}

.consent-icon {
    flex-shrink: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.consent-icon svg {
    display: block;
}

.consent-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.consent-text strong {
    font-size: 0.92rem;
    color: #e0e0e0;
}

.consent-btn.selected .consent-text strong {
    color: #f5f5f5;
}

.consent-text small {
    font-size: 0.78rem;
    color: #707070;
}

.consent-btn.selected .consent-text small {
    color: #b0a080;
}

.consent-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #606060;
    padding: 10px 14px;
    background: rgba(200, 180, 140, 0.03);
    border-radius: 8px;
}

.consent-note svg {
    flex-shrink: 0;
    color: #606060;
}

/* ============================================================================
   Tone Scan (Step 6)
   ============================================================================ */

.tone-intro {
    font-size: 0.95rem;
    color: #c0c0c0;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.6;
}

.tone-options {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 16px;
}

.tone-btn {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 18px;
    background: rgba(200, 180, 140, 0.04);
    border: 1.5px solid rgba(200, 180, 140, 0.1);
    border-radius: 12px;
    color: #a0a0a0;
    cursor: pointer;
    transition: all 0.25s;
    text-align: left;
    width: 100%;
}

.tone-btn:hover {
    border-color: rgba(200, 180, 140, 0.3);
    background: rgba(200, 180, 140, 0.08);
    transform: translateX(4px);
}

.tone-btn.selected {
    border-color: #c8b48c;
    background: rgba(200, 180, 140, 0.12);
    color: #c8b48c;
    box-shadow: 0 0 16px rgba(200, 180, 140, 0.08);
}

.tone-color {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    opacity: 0.7;
    transition: opacity 0.2s, transform 0.2s;
}

.tone-btn.selected .tone-color {
    opacity: 1;
    transform: scale(1.1);
}

.tone-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.tone-info strong {
    font-size: 0.95rem;
    color: #e0e0e0;
}

.tone-btn.selected .tone-info strong {
    color: #f5f5f5;
}

.tone-info small {
    font-size: 0.8rem;
    color: #707070;
}

.tone-btn.selected .tone-info small {
    color: #b0a080;
}

.tone-tip {
    text-align: center;
    font-size: 0.82rem;
    color: rgba(200, 180, 140, 0.5);
    margin: 0;
}

/* ============================================================================
   Ready Screen (Step 7)
   ============================================================================ */

.ready-companion {
    text-align: center;
    padding: 30px 20px;
    margin-bottom: 24px;
}

.ready-companion-icon {
    margin: 0 auto 16px;
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c8b48c;
}

.ready-companion-icon svg {
    width: 56px;
    height: 56px;
    display: block;
}

.ready-companion h3 {
    font-family: 'Crimson Pro', serif;
    font-size: 1.6rem;
    color: #f5f5f5;
    margin: 0 0 4px;
    font-weight: 400;
}

.ready-companion-role {
    font-size: 0.9rem;
    color: #c8b48c;
    display: block;
    margin-bottom: 18px;
}

.ready-greeting {
    background: rgba(200, 180, 140, 0.06);
    border-left: 3px solid rgba(200, 180, 140, 0.3);
    border-radius: 0 10px 10px 0;
    padding: 16px 20px;
    display: inline-block;
    max-width: 420px;
}

.ready-greeting p {
    font-family: 'Crimson Pro', serif;
    font-style: italic;
    font-size: 1.05rem;
    color: #c8c0a8;
    margin: 0;
    line-height: 1.6;
}

/* Confirmations */
.ready-confirmations {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 10px;
}

.onboarding-checkbox-group {
    background: rgba(20, 20, 35, 0.5);
    padding: 14px;
    border-radius: 10px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 22px;
    height: 22px;
    border: 2px solid rgba(200, 180, 140, 0.35);
    border-radius: 5px;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s;
    margin-top: 1px;
}

.checkbox-label input:checked + .checkbox-custom {
    background: #c8b48c;
    border-color: #c8b48c;
}

.checkbox-label input:checked + .checkbox-custom::after {
    content: '\2713';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #1a1a2e;
    font-size: 14px;
    font-weight: bold;
}

.checkbox-text {
    font-size: 0.9rem;
    color: #c0c0c0;
    line-height: 1.45;
}

/* ============================================================================
   Buttons
   ============================================================================ */

.onboarding-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    align-items: center;
}

.onboarding-btn {
    padding: 13px 28px;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s;
    border: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
}

.onboarding-btn.primary {
    background: linear-gradient(135deg, #c8b48c 0%, #a08050 100%);
    color: #1a1a2e;
}

.onboarding-btn.primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(200, 180, 140, 0.25);
}

.onboarding-btn.primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.onboarding-btn.primary.glow {
    box-shadow: 0 0 20px rgba(200, 180, 140, 0.15);
}

.onboarding-btn.primary.glow:hover {
    box-shadow: 0 4px 30px rgba(200, 180, 140, 0.35);
}

.onboarding-btn.secondary {
    background: transparent;
    color: #a0a0a0;
    border: 1px solid rgba(160, 160, 160, 0.25);
}

.onboarding-btn.secondary:hover {
    border-color: #c8b48c;
    color: #c8b48c;
}

.onboarding-btn.text-btn {
    background: transparent;
    color: #707070;
    border: none;
    padding: 13px 16px;
    font-size: 0.9rem;
}

.onboarding-btn.text-btn:hover {
    color: #a0a0a0;
}

.btn-arrow {
    font-size: 1.1rem;
}

/* ============================================================================
   Progress Dots
   ============================================================================ */

.onboarding-progress {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 28px;
}

.progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(200, 180, 140, 0.15);
    transition: all 0.35s ease;
}

.progress-dot.active {
    background: #c8b48c;
    transform: scale(1.25);
    box-shadow: 0 0 8px rgba(200, 180, 140, 0.3);
}

.progress-dot.completed {
    background: rgba(200, 180, 140, 0.45);
}

/* ============================================================================
   Validation Error
   ============================================================================ */

.validation-error {
    background: rgba(220, 53, 69, 0.15);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #ff6b6b;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 0.9rem;
    animation: fadeSlideIn 0.25s ease;
}

/* ============================================================================
   Completion Animation
   ============================================================================ */

.completion-animation {
    text-align: center;
    padding: 60px 20px;
    animation: fadeSlideIn 0.5s ease;
}

.completion-icon {
    font-size: 4rem;
    color: #c8b48c;
    animation: completePulse 1.2s ease-in-out infinite;
    margin-bottom: 20px;
}

.completion-animation h2 {
    font-family: 'Crimson Pro', serif;
    font-size: 2rem;
    color: #f5f5f5;
    margin: 0 0 10px;
}

.completion-animation p {
    color: #c8b48c;
    font-size: 1.05rem;
}

@keyframes completePulse {
    0%, 100% { transform: scale(1); opacity: 0.85; }
    50%      { transform: scale(1.1); opacity: 1; }
}

.loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(26, 26, 46, 0.3);
    border-top-color: #1a1a2e;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ============================================================================
   Mobile Responsive
   ============================================================================ */

@media (max-width: 768px) {
    .onboarding-container {
        padding: 28px 20px;
        margin: 10px;
        border-radius: 16px;
    }

    .onboarding-header h1 {
        font-size: 2rem;
    }

    .onboarding-header h2 {
        font-size: 1.5rem;
    }

    .welcome-principles {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .principle {
        display: flex;
        align-items: center;
        text-align: left;
        gap: 14px;
        padding: 16px;
    }

    .principle-icon {
        margin: 0;
        flex-shrink: 0;
    }

    .how-cards {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .how-card {
        display: flex;
        align-items: flex-start;
        text-align: left;
        gap: 14px;
        padding: 18px;
    }

    .how-card-icon {
        margin: 0;
        flex-shrink: 0;
    }

    .feeling-options {
        gap: 8px;
    }

    .feeling-btn {
        padding: 12px 14px;
        min-width: 60px;
    }

    .comm-options {
        gap: 8px;
    }

    .comm-btn {
        padding: 14px 12px;
    }

    .onboarding-buttons {
        flex-wrap: wrap;
    }

    .onboarding-btn {
        flex: 1;
        min-width: 100px;
        justify-content: center;
    }

    .onboarding-btn.text-btn {
        flex: 0 0 auto;
        order: 3;
    }

    .progress-dot {
        width: 8px;
        height: 8px;
    }

    .ready-companion-icon svg {
        width: 48px;
        height: 48px;
    }
}

@media (max-width: 380px) {
    .onboarding-container {
        padding: 22px 16px;
    }

    .onboarding-header h1 {
        font-size: 1.7rem;
    }

    .onboarding-logo {
        font-size: 2.5rem;
    }

    .feeling-options {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }
}
