/* --- How it Works Page --- */
:root {
    --primary-violet: #6d28d9;
    --primary-glow: rgba(109, 40, 217, 0.4);
    --glass-bg: rgba(255, 255, 255, 0.03);
    --glass-border: rgba(255, 255, 255, 0.08);
}

.how-works-page {
    position: relative;
    padding-top: 100px;
    background: #050212;
    color: white;
    overflow-x: hidden;
}

[data-theme="light"] .how-works-page {
    background: #f8fafc;
    color: #0f172a;
}

/* --- Ambient Background --- */
.ambient-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
}

.glow-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(120px);
    opacity: 0.15;
    animation: orbFloat 20s infinite alternate ease-in-out;
}

.orb-1 { width: 600px; height: 600px; background: var(--primary-violet); top: -100px; right: -100px; }
.orb-2 { width: 500px; height: 500px; background: #4f46e5; bottom: -100px; left: -100px; }
.orb-3 { width: 400px; height: 400px; background: #8b5cf6; top: 40%; left: 30%; opacity: 0.1; }

@keyframes orbFloat {
    from { transform: translate(0, 0) scale(1); }
    to { transform: translate(50px, 50px) scale(1.1); }
}

/* --- Hero --- */
.how-hero {
    position: relative;
    z-index: 10;
    text-align: center;
    padding: 80px 0;
}

.how-hero h1 {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 800;
    margin-bottom: 20px;
    letter-spacing: -2px;
}

.text-gradient {
    background: linear-gradient(135deg, #a78bfa, #6d28d9);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    font-size: 1.25rem;
    opacity: 0.7;
    max-width: 600px;
    margin: 0 auto;
}

/* --- Flow Section --- */
.flow-section {
    position: relative;
    z-index: 10;
    padding: 100px 0;
}

.flow-container {
    position: relative;
    margin-top: 60px;
}

/* Timeline Desktop */
.flow-line-desktop {
    position: absolute;
    top: 50px;
    left: 5%;
    right: 5%;
    height: 4px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 2px;
    z-index: -1;
    overflow: hidden;
}

.flow-progress {
    width: 0;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary-violet), #a78bfa);
    transition: width 0.8s ease;
}

.flow-steps {
    display: flex;
    justify-content: space-between;
    gap: 40px;
}

.flow-step {
    flex: 1;
    text-align: center;
    position: relative;
}

.step-icon {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin: 0 auto 30px;
    color: var(--primary-violet);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.flow-step:hover .step-icon {
    transform: translateY(-10px) scale(1.05);
    border-color: var(--primary-violet);
    box-shadow: 0 20px 40px var(--primary-glow);
}

.ai-highlight {
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.1), rgba(167, 139, 250, 0.1));
    border-color: var(--primary-violet);
    color: #a78bfa;
}

.step-content {
    min-height: 120px; /* Increased to accommodate 3 lines comfortably */
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

.step-content h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 12px;
}

.step-content p {
    font-size: 0.95rem;
    opacity: 0.6;
    line-height: 1.6;
}

/* Mockups common styles */
.ui-mockup, .success-state {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    color: inherit;
}

.mock-item, .mock-input, .mock-status {
    padding: 10px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.mock-btn, .mock-validate-btn, .suggestion-bubble {
    background: var(--primary-violet);
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    font-weight: 600;
    color: white !important; /* Force white text */
    box-shadow: 0 4px 12px var(--primary-glow);
}

.suggestion-bubble {
    margin-top: 20px;
    border-radius: 12px 12px 12px 0;
    text-align: left;
}

.check-anim {
    width: 50px;
    height: 50px;
    background: #10b981;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.4);
}

.client-feedback {
    text-align: center;
    font-style: italic;
    opacity: 0.8;
}

/* --- Visual Mockups --- */
.step-visual {
    margin-top: 40px;
    min-height: 200px;
    padding: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.glass-card {
    background: rgba(255, 255, 255, 0.02);
    backdrop-filter: blur(10px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    transition: all 0.6s ease;
}

/* AI Core Animation */
.ai-engine-core {
    position: relative;
    width: 100%;
}

.core-rings {
    width: 80px;
    height: 80px;
    border: 2px solid var(--primary-violet);
    border-radius: 50%;
    margin: 0 auto;
    position: relative;
    animation: corePulse 2s infinite;
}

.core-rings::after {
    content: '';
    position: absolute;
    top: -10px; left: -10px; right: -10px; bottom: -10px;
    border: 1px solid rgba(167, 139, 250, 0.3);
    border-radius: 50%;
    animation: corePulse 2s infinite 0.5s;
}

@keyframes corePulse {
    0% { transform: scale(1); opacity: 1; }
    100% { transform: scale(1.5); opacity: 0; }
}

.suggestion-bubble {
    background: var(--primary-violet);
    padding: 12px 20px;
    border-radius: 12px 12px 12px 0;
    margin-top: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 10px 20px var(--primary-glow);
}

/* --- Role Sections --- */
.roles-section {
    padding: 100px 0;
    z-index: 10;
    position: relative;
}

.roles-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.role-card {
    padding: 60px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--glass-border);
    border-radius: 40px;
    transition: all 0.5s ease;
}

.role-card:hover {
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(109, 40, 217, 0.2);
}

.role-tag {
    display: inline-block;
    padding: 6px 16px;
    background: rgba(109, 40, 217, 0.1);
    color: #a78bfa;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.role-header h2 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 30px;
}

.role-features {
    list-style: none;
    margin-bottom: 40px;
}

.role-features li {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-size: 1.1rem;
    opacity: 0.8;
}

.role-features i {
    color: var(--primary-violet);
    font-size: 1.4rem;
}

/* Mockups Role */
.role-visual {
    height: 240px;
    background: rgba(0,0,0,0.2);
    border-radius: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.05);
}

.phone-mockup {
    width: 140px;
    height: 200px;
    background: #111;
    border-radius: 20px;
    border: 4px solid #222;
    position: relative;
    overflow: hidden;
}

.ai-suggest-pop {
    position: absolute;
    bottom: 20px;
    left: 10px;
    right: 10px;
    background: var(--primary-violet);
    padding: 8px;
    border-radius: 8px;
    font-size: 0.7rem;
    animation: popUp 3s infinite;
}

@keyframes popUp {
    0%, 100% { transform: translateY(20px); opacity: 0; }
    20%, 80% { transform: translateY(0); opacity: 1; }
}

/* --- Final CTA --- */
.final-cta {
    padding: 100px 0 140px;
    position: relative;
    z-index: 10;
}

.cta-glass {
    padding: 100px 40px;
    background: linear-gradient(135deg, rgba(109, 40, 217, 0.08), rgba(167, 139, 250, 0.03));
    border: 1px solid rgba(109, 40, 217, 0.3);
    border-radius: 60px;
    backdrop-filter: blur(30px);
    text-align: center;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.2);
}

.cta-glass h2 {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    margin-bottom: 40px;
    letter-spacing: -2px;
    line-height: 1.1;
}

.cta-btns {
    display: flex;
    gap: 20px;
    justify-content: center;
    align-items: center;
}

.cta-btns .btn-primary, .cta-btns .btn-secondary {
    padding: 18px 40px;
    border-radius: 18px;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.cta-btns .btn-primary {
    background: var(--primary-violet);
    color: white;
    box-shadow: 0 10px 20px var(--primary-glow);
}

.cta-btns .btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 20px 40px var(--primary-glow);
    filter: brightness(1.1);
}

.cta-btns .btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
}

[data-theme="light"] .cta-btns .btn-secondary {
    color: var(--text-primary-light);
    border-color: rgba(0,0,0,0.1);
}

.cta-btns .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-4px);
    border-color: var(--primary-violet);
}

/* --- Mobile --- */
@media (max-width: 992px) {
    .flow-steps {
        flex-direction: column;
        gap: 60px;
    }
    .flow-line-desktop {
        display: none;
    }
    .roles-grid {
        grid-template-columns: 1fr;
    }
    .role-card {
        padding: 40px;
    }
    .cta-glass {
        padding: 60px 20px;
        border-radius: 40px;
    }
    .cta-btns {
        flex-direction: column;
        width: 100%;
    }
    .cta-btns a {
        width: 100%;
        justify-content: center;
    }
    .flow-step::after {
        content: '';
        position: absolute;
        bottom: -40px;
        left: 50%;
        width: 2px;
        height: 30px;
        background: var(--glass-border);
    }
    .flow-step:last-child::after { display: none; }
}

/* --- Dark/Light Mode Adjustments --- */
[data-theme="light"] .glass-card,
[data-theme="light"] .role-card,
[data-theme="light"] .step-icon {
    background: rgba(0, 0, 0, 0.02);
    border-color: rgba(0, 0, 0, 0.05);
}

[data-theme="light"] .role-features li {
    color: #1e293b;
}
