/* =========================================
   PROFILE BUILDER - PRO EDITION STYLES
   ========================================= */
:root {
    --primary: #4F46E5;
    --primary-hover: #4338ca;
    --primary-light: #EEF2FF;
    --accent: #a855f7;
    --success: #10B981;
    --text-main: #0f172a;
    --text-muted: #64748B;
    --bg-white: #ffffff;
    --bg-slate: #f8fafc;
    --border-soft: #e2e8f0;
}

.profile-builder-vw {
    position: relative;
    padding: 140px 0;
    background: var(--bg-slate);
    font-family: 'Inter', sans-serif;
    overflow: hidden;
    z-index: 1;
}

/* Tła i świecenia dla głębi 3D */
.bg-glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: -1;
    opacity: 0.4;
    animation: floatGlow 10s ease-in-out infinite alternate;
}
.glow-1 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, rgba(79,70,229,0.3) 0%, rgba(0,0,0,0) 70%);
    top: -100px; right: -100px;
}
.glow-2 {
    width: 600px; height: 600px;
    background: radial-gradient(circle, rgba(168,85,247,0.2) 0%, rgba(0,0,0,0) 70%);
    bottom: -200px; left: -100px;
    animation-delay: -5s;
}

@keyframes floatGlow {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(-30px, 50px) scale(1.1); }
}

.builder-container {
    max-width: 1350px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 80px;
    align-items: center;
    padding: 0 40px;
}

/* --- TYPOGRAFIA I ZNACZKI --- */
.builder-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    color: var(--primary);
    padding: 10px 20px;
    border-radius: 99px;
    font-weight: 700;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 24px;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.15);
    border: 1px solid var(--primary-light);
}

.builder-title {
    font-size: clamp(2.8rem, 4vw, 4.2rem);
    font-weight: 800;
    line-height: 1.05;
    color: var(--text-main);
    margin-bottom: 60px;
    letter-spacing: -1.5px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    display: inline-block;
}

/* --- KROKI (MENU PO LEWEJ) --- */
.steps-container {
    display: flex;
    flex-direction: column;
    gap: 16px;
    position: relative;
}

.step-item {
    position: relative;
    display: flex;
    gap: 25px;
    padding: 32px 30px;
    border-radius: 24px;
    background: transparent;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.16, 1, 0.3, 1);
    border: 1px solid transparent;
    overflow: hidden;
}

.step-item::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg, rgba(255,255,255,0.8), rgba(255,255,255,0.4));
    opacity: 0;
    transition: opacity 0.5s;
    z-index: -1;
    border-radius: 24px;
}

.step-item:hover::before { opacity: 1; }

.step-item.active {
    background: var(--bg-white);
    box-shadow: 0 20px 40px -10px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(79, 70, 229, 0.1);
    transform: translateX(15px);
}

/* Pionowa linia łącząca kroki (optyczny przewodnik) */
.step-line {
    position: absolute;
    left: 45px;
    top: 85px;
    bottom: -40px;
    width: 2px;
    background: var(--border-soft);
    z-index: 0;
}
.step-item:last-child .step-line { display: none; }

.step-number {
    position: relative;
    font-size: 1.2rem;
    font-weight: 800;
    color: #cbd5e1;
    background: white;
    width: 45px; height: 45px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    border: 2px solid var(--border-soft);
    transition: all 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 1;
}

.step-item.active .step-number {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
    box-shadow: 0 10px 20px rgba(79, 70, 229, 0.3);
    transform: scale(1.15);
}

.step-text { z-index: 1; }
.step-text h3 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 10px;
    color: var(--text-main);
    transition: color 0.3s;
}
.step-item.active .step-text h3 { color: var(--primary); }
.step-text p {
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.6;
    margin: 0;
}

/* --- MOCKUP URZĄDZENIA (PRAWA STRONA) --- */
.builder-visual {
    position: relative;
    perspective: 1200px;
    display: flex;
    justify-content: center;
}

.device-mockup {
    position: relative;
    background: var(--bg-white);
    border-radius: 36px;
    box-shadow: 
        0 40px 80px -20px rgba(15, 23, 42, 0.15),
        inset 0 0 0 8px #f1f5f9,
        inset 0 0 0 9px #e2e8f0;
    border: 1px solid #cbd5e1;
    width: 100%;
    max-width: 420px;
    height: 700px;
    overflow: hidden;
    transform: rotateY(-12deg) rotateX(5deg) translateZ(0);
    transition: transform 0.8s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.8s;
    z-index: 2;
    display: flex;
    flex-direction: column;
}

.builder-visual:hover .device-mockup {
    transform: rotateY(-2deg) rotateX(2deg) translateY(-10px);
    box-shadow: 
        0 50px 100px -20px rgba(15, 23, 42, 0.2),
        inset 0 0 0 8px #f1f5f9,
        inset 0 0 0 9px #e2e8f0;
}

.glass-reflection {
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    transform: skewX(-20deg);
    z-index: 10;
    pointer-events: none;
    animation: glassShine 6s infinite;
}

@keyframes glassShine {
    0%, 100% { left: -100%; }
    20%, 80% { left: 200%; }
}

.window-header {
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    padding: 16px 20px;
    display: flex;
    align-items: center;
    border-bottom: 1px solid var(--border-soft);
    z-index: 5;
}

.window-header .dots { display: flex; gap: 6px; }
.window-header .dots span {
    width: 12px; height: 12px;
    border-radius: 50%;
}
.window-header .dots span:nth-child(1) { background: #ff5f56; }
.window-header .dots span:nth-child(2) { background: #ffbd2e; }
.window-header .dots span:nth-child(3) { background: #27c93f; }

.address-bar {
    margin: 0 15px;
    background: var(--bg-slate);
    border-radius: 12px;
    padding: 8px 12px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.header-menu { color: var(--text-muted); font-size: 1.1rem; }

.preview-body {
    flex: 1;
    background: #f8fafc;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
}
/* Ukrycie paska scrolla w mockapie */
.preview-body::-webkit-scrollbar { display: none; }

/* --- PŁYWAJĄCE ELEMENTY (PARALLAX 3D) --- */
.floating-elements {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
}

.float-card {
    position: absolute;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.5);
    padding: 12px 20px;
    border-radius: 16px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 15px;
    animation: floatObj 6s ease-in-out infinite alternate;
}

.icon-wrap {
    width: 40px; height: 40px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem; color: white;
}
.icon-wrap.success { background: var(--success); }
.icon-wrap.primary { background: var(--primary); }
.icon-wrap.accent { background: var(--accent); }

.card-info { display: flex; flex-direction: column; }
.card-info span { font-size: 0.7rem; color: var(--text-muted); font-weight: 600; text-transform: uppercase;}
.card-info strong { font-size: 0.95rem; color: var(--text-main); font-weight: 800; }

.card-1 { top: 15%; left: -60px; animation-delay: 0s; }
.card-2 { bottom: 25%; right: -50px; animation-delay: -2s; }
.card-3 { top: 40%; right: -30px; padding: 15px; border-radius: 50%; animation-delay: -4s; }

@keyframes floatObj {
    0% { transform: translateY(0) translateZ(50px); }
    100% { transform: translateY(-20px) translateZ(50px); }
}

/* --- KLASY DYNAMICZNE WSTRZYKIWANE PRZEZ JS --- */
.inject-view {
    padding: 24px;
    animation: fadeInScale 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes fadeInScale {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

/* System opóźnień animacji dla elementów w mockapie (Staggering) */
.anim-el { opacity: 0; animation: slideUpFill 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards; }
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }

@keyframes slideUpFill {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- KROK 2: PAYMENT ELEMENTS --- */
.payment-setup-card {
    background: white;
    border-radius: 20px;
    padding: 10px;
    border: 1px solid var(--border-soft);
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
}

.pay-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    border-bottom: 1px solid #f8fafc;
}
.pay-row:last-child { border-bottom: none; }

.pay-brand { display: flex; align-items: center; gap: 12px; font-weight: 700; font-size: 0.9rem; color: var(--text-main); }

/* Switch Style */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
    position: absolute; cursor: pointer; inset: 0;
    background-color: #e2e8f0; transition: .4s; border-radius: 34px;
}
.slider:before {
    position: absolute; content: ""; height: 16px; width: 16px; left: 3px; bottom: 3px;
    background-color: white; transition: .4s; border-radius: 50%;
}
input:checked + .slider { background-color: var(--success); }
input:checked + .slider:before { transform: translateX(18px); }

/* --- KROK 3: DASHBOARD ELEMENTS --- */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 15px; }
.stat-mini { background: white; padding: 15px; border-radius: 18px; border: 1px solid var(--border-soft); }
.stat-mini span { display: block; font-size: 0.65rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }
.stat-mini strong { font-size: 1.1rem; color: var(--text-main); }

.balance-card {
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 100%);
    padding: 25px; border-radius: 24px; color: white;
}
.balance-label { font-size: 0.75rem; opacity: 0.7; margin-bottom: 5px; }
.balance-amount { font-size: 2rem; font-weight: 800; letter-spacing: -1px; }
.balance-amount small { font-size: 1rem; opacity: 0.6; }

.sale-item {
    display: flex; align-items: center; gap: 12px; background: white;
    padding: 12px; border-radius: 16px; margin-bottom: 8px; border: 1px solid var(--border-soft);
}
.sale-avatar { width: 35px; height: 35px; border-radius: 10px; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.7rem; }
.sale-info { flex: 1; display: flex; flex-direction: column; }
.sale-info strong { font-size: 0.85rem; color: var(--text-main); }
.sale-info span { font-size: 0.7rem; color: var(--text-muted); }
.sale-price { font-weight: 800; color: #10B981; font-size: 0.9rem; }

.success-badge-float {
    display: inline-flex; align-items: center; gap: 8px; background: #dcfce7;
    color: #16a34a; padding: 8px 16px; border-radius: 99px; font-weight: 800;
    font-size: 0.75rem; margin-top: 15px; box-shadow: 0 5px 15px rgba(22, 163, 74, 0.1);
}

.drag-handle { color: #cbd5e1; cursor: grab; }
.active-drag { cursor: grab; }

/* Elementy UI widoków (współdzielone) */
.ui-avatar { width: 80px; height: 80px; border-radius: 50%; border: 4px solid white; box-shadow: 0 10px 20px rgba(0,0,0,0.1); margin: 0 auto; display: block; object-fit: cover;}
.ui-title { text-align: center; font-size: 1.2rem; font-weight: 800; margin: 15px 0 5px; color: var(--text-main); }
.ui-subtitle { text-align: center; font-size: 0.85rem; color: var(--text-muted); margin-bottom: 25px; }

.ui-module { background: white; border-radius: 16px; padding: 16px; margin-bottom: 12px; display: flex; align-items: center; gap: 15px; border: 1px solid var(--border-soft); box-shadow: 0 4px 6px rgba(0,0,0,0.02); transition: 0.3s; }
.ui-module:hover { transform: translateY(-2px); box-shadow: 0 8px 15px rgba(0,0,0,0.05); }
.ui-icon-box { width: 45px; height: 45px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.2rem; }
.ui-module-text h4 { margin: 0 0 4px; font-size: 0.95rem; font-weight: 700; color: var(--text-main); }
.ui-module-text p { margin: 0; font-size: 0.75rem; color: var(--text-muted); }

/* Motywy widoku 2 */
.theme-selector { display: flex; gap: 10px; justify-content: center; margin: 20px 0; }
.theme-btn { width: 35px; height: 35px; border-radius: 50%; cursor: pointer; border: 3px solid white; box-shadow: 0 4px 10px rgba(0,0,0,0.1); transition: 0.3s; }
.theme-btn.active { transform: scale(1.2); }

/* Sukces widoku 3 */
.success-circle { width: 100px; height: 100px; background: var(--success); border-radius: 50%; margin: 0 auto 20px; display: flex; align-items: center; justify-content: center; color: white; font-size: 2.5rem; box-shadow: 0 10px 30px rgba(16, 185, 129, 0.4); animation: pulseSuccess 2s infinite; }
@keyframes pulseSuccess { 0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.4); } 70% { box-shadow: 0 0 0 20px rgba(16, 185, 129, 0); } 100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); } }

.chart-mockup { height: 120px; background: linear-gradient(180deg, var(--primary-light) 0%, white 100%); border-radius: 16px; margin-top: 20px; position: relative; overflow: hidden; border: 1px solid var(--border-soft); display:flex; align-items:flex-end; padding: 15px; gap: 8px;}
.chart-bar { flex: 1; background: var(--primary); border-radius: 4px 4px 0 0; animation: growBar 1s cubic-bezier(0.16, 1, 0.3, 1) forwards; transform-origin: bottom; opacity: 0.8; }
@keyframes growBar { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* --- RESPONSYWNOŚĆ --- */
@media (max-width: 1100px) {
    .builder-container { grid-template-columns: 1fr; gap: 60px; text-align: center; }
    .step-item { text-align: left; }
    .device-mockup { transform: none !important; margin: 0 auto; height: 600px; }
    .builder-visual:hover .device-mockup { transform: translateY(-10px) !important; }
    .float-card { display: none; } /* Ukrywamy na mobilkach by nie śmiecić */
    .step-line { display: none; }
}
@media (max-width: 768px) {
    .profile-builder-vw { padding: 80px 0; }
    .builder-title { font-size: 2.2rem; }
    .step-item { padding: 20px; flex-direction: column; gap: 15px; }
}