/* =========================================
   ProLab Contact Bubble — Hyros-style
   Dark Navy + Purple (malgorzatadobrowolska.pl)
   ========================================= */

@import url('https://fonts.googleapis.com/css2?family=Sora:wght@400;500;600;700&family=DM+Serif+Display&display=swap');

:root {
    --pcb-navy-900: #070a1f;
    --pcb-navy-800: #0a0d29;
    --pcb-navy-700: #101540;
    --pcb-navy-600: #141b54;
    --pcb-purple: #6f00ff;
    --pcb-purple-hover: #7817f6;
    --pcb-purple-glow: rgba(111, 0, 255, 0.4);
    --pcb-purple-soft: rgba(111, 0, 255, 0.1);
    --pcb-yellow: #dbf059;
    --pcb-yellow-glow: rgba(219, 240, 89, 0.3);
    --pcb-text: #f0f2f8;
    --pcb-text-muted: #9ba3c2;
    --pcb-text-dim: #5c6488;
    --pcb-success: #dbf059;
    --pcb-success-glow: rgba(219, 240, 89, 0.3);
    --pcb-danger: #f87171;
    --pcb-border: rgba(111, 0, 255, 0.15);
    --pcb-glass: #0a0d29;
    --pcb-radius: 16px;
    --pcb-radius-sm: 6px;
    --pcb-transition: cubic-bezier(0.16, 1, 0.3, 1);
    --pcb-font: 'Sora', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --pcb-font-heading: 'DM Serif Display', serif;
}

/* ---- Reset ---- */
#pcb-bubble-wrap,
#pcb-bubble-wrap *,
#pcb-bubble-wrap *::before,
#pcb-bubble-wrap *::after {
    box-sizing: border-box !important;
    font-family: var(--pcb-font);
}

/* =========================================
   BUBBLE BUTTON
   ========================================= */
#pcb-bubble {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 999999;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    border: none;
    cursor: pointer;
    background: var(--pcb-purple);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 4px 20px var(--pcb-purple-glow),
        0 0 0 0 rgba(111, 0, 255, 0.5);
    transition: all 0.4s var(--pcb-transition);
    animation: pcb-pulse 2.8s ease-in-out infinite;
}

#pcb-bubble:hover {
    transform: scale(1.1);
    box-shadow:
        0 8px 36px rgba(111, 0, 255, 0.55),
        0 0 0 10px rgba(111, 0, 255, 0.08);
}

#pcb-bubble:active {
    transform: scale(0.95);
}

@keyframes pcb-pulse {
    0%, 100% {
        box-shadow: 0 6px 28px var(--pcb-purple-glow), 0 0 0 0 rgba(111, 0, 255, 0.5);
    }
    50% {
        box-shadow: 0 6px 28px var(--pcb-purple-glow), 0 0 0 14px rgba(111, 0, 255, 0);
    }
}

/* Icons */
.pcb-icon {
    width: 28px;
    height: 28px;
    transition: all 0.4s var(--pcb-transition);
    position: absolute;
}

.pcb-icon-chat {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

.pcb-icon-close {
    opacity: 0;
    transform: scale(0.5) rotate(-90deg);
}

#pcb-bubble.pcb-open .pcb-icon-chat {
    opacity: 0;
    transform: scale(0.5) rotate(90deg);
}

#pcb-bubble.pcb-open .pcb-icon-close {
    opacity: 1;
    transform: scale(1) rotate(0deg);
}

/* =========================================
   FORM PANEL
   ========================================= */
#pcb-form-panel {
    position: fixed;
    bottom: 108px;
    right: 28px;
    z-index: 999998;
    width: 420px;
    max-height: calc(100vh - 140px);
    overflow: hidden;
    border-radius: var(--pcb-radius);
    background: var(--pcb-glass);
    backdrop-filter: blur(28px) saturate(1.5);
    -webkit-backdrop-filter: blur(28px) saturate(1.5);
    border: 1px solid var(--pcb-border);
    box-shadow:
        0 16px 48px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(111, 0, 255, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(24px) scale(0.95);
    transform-origin: bottom right;
    transition:
        opacity 0.5s var(--pcb-transition),
        transform 0.5s var(--pcb-transition),
        visibility 0.5s;
}

#pcb-form-panel.pcb-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.pcb-form-inner {
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    max-height: calc(100vh - 140px);
}

/* Custom scrollbar */
.pcb-form-inner::-webkit-scrollbar {
    width: 4px;
}
.pcb-form-inner::-webkit-scrollbar-track {
    background: transparent;
}
.pcb-form-inner::-webkit-scrollbar-thumb {
    background: var(--pcb-navy-600);
    border-radius: 10px;
}

/* =========================================
   STEPS — Slide transitions
   ========================================= */
.pcb-step {
    display: none;
    animation: pcb-stepIn 0.45s var(--pcb-transition);
}

.pcb-step.pcb-step-active {
    display: block;
}

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

/* Reverse animation for back */
.pcb-step.pcb-step-back {
    animation: pcb-stepBack 0.45s var(--pcb-transition);
}

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

/* =========================================
   STEP 1: GREETING
   ========================================= */
.pcb-greeting-content {
    padding: 28px 24px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Avatars group — all same size */
.pcb-avatars-group {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.pcb-team-avatar {
    width: 32px !important;
    height: 32px !important;
    min-width: 32px;
    min-height: 32px;
    border-radius: 50%;
    object-fit: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2.5px solid var(--pcb-navy-800);
    margin-left: -8px;
    position: relative;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
}

.pcb-team-avatar:first-child {
    margin-left: 0;
    z-index: 4;
}

.pcb-team-avatar:nth-child(2) { z-index: 3; }
.pcb-team-avatar:nth-child(3) { z-index: 2; }
.pcb-team-avatar:nth-child(4) { z-index: 1; }

.pcb-team-initials {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.3px;
    color: #fff;
}

.pcb-team-initials:nth-of-type(1) {
    background: linear-gradient(135deg, var(--pcb-purple), #9333ea);
}

.pcb-team-initials:nth-of-type(2) {
    background: linear-gradient(135deg, #06b6d4, #0ea5e9);
}

.pcb-team-initials:nth-of-type(3) {
    background: linear-gradient(135deg, #f59e0b, #f97316);
}

/* Profile row */
.pcb-profile-row {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px !important;
}

.pcb-profile-info h3 {
    font-family: var(--pcb-font) !important;
    font-size: 16px;
    font-weight: 600;
    color: var(--pcb-text);
    margin-bottom: 4px !important;
}

.pcb-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    color: #34d399;
}

.pcb-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    display: inline-block;
    animation: pcb-dot-pulse 2s ease-in-out infinite;
}

@keyframes pcb-dot-pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

/* Avatar with Instagram-style rotating ring */
.pcb-avatar-ring {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
    border-radius: 50%;
}

.pcb-avatar-ring::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 50%;
    background: conic-gradient(
        var(--pcb-purple),
        #a855f7,
        var(--pcb-yellow),
        #34d399,
        #06b6d4,
        var(--pcb-purple)
    );
    animation: pcb-ring-spin 3s linear infinite;
}

.pcb-avatar-ring::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    background: var(--pcb-navy-800);
    z-index: 1;
}

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

.pcb-avatar-large {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    border: none;
    box-shadow: none;
}


.pcb-greeting-sub {
    font-size: 13px;
    font-weight: 400;
    color: var(--pcb-text-dim);
    margin-bottom: 8px !important;
    padding-left: 2px;
}

/* CTA Card */
#pcb-go-form {
    display: flex;
    align-items: center;
    gap: 14px;
    width: calc(100% - 48px);
    margin: 8px 24px 32px;
    padding: 18px 20px;
    background: rgba(111, 0, 255, 0.08);
    border: 1.5px solid rgba(111, 0, 255, 0.18);
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.3s var(--pcb-transition);
    text-align: left;
    font-family: var(--pcb-font);
    color: var(--pcb-text);
}

#pcb-go-form:hover {
    background: rgba(111, 0, 255, 0.14);
    border-color: rgba(111, 0, 255, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 8px 28px rgba(111, 0, 255, 0.15);
}

.pcb-cta-icon {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--pcb-purple);
    display: flex;
    align-items: center;
    justify-content: center;
}

.pcb-cta-icon svg {
    width: 22px;
    height: 22px;
    stroke: #fff;
}

.pcb-cta-text {
    flex: 1;
    min-width: 0;
}

.pcb-cta-title {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--pcb-text);
    margin-bottom: 2px;
}

.pcb-cta-desc {
    display: block;
    font-size: 11.5px;
    font-weight: 400;
    color: var(--pcb-text-muted);
    line-height: 1.4;
}

.pcb-cta-arrow {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    opacity: 0.4;
    transition: all 0.3s ease;
}

.pcb-cta-arrow svg {
    width: 20px;
    height: 20px;
    stroke: var(--pcb-text-muted);
}

#pcb-go-form:hover .pcb-cta-arrow {
    opacity: 0.8;
    transform: translateX(3px);
}

/* =========================================
   STEP 2: FORM
   ========================================= */

/* Form header with back button */
.pcb-form-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 24px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    margin-bottom: 8px;
}

.pcb-back-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px;
    min-height: 36px;
    padding: 0 !important;
    border-radius: 10px;
    border: 1.5px solid rgba(111, 0, 255, 0.15);
    background: rgba(111, 0, 255, 0.06);
    color: var(--pcb-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    flex-shrink: 0;
    line-height: 0;
}

.pcb-back-btn:hover {
    background: rgba(111, 0, 255, 0.12);
    border-color: rgba(111, 0, 255, 0.25);
    color: var(--pcb-text);
}

.pcb-back-btn {
    font-size: 22px !important;
    color: var(--pcb-text-muted) !important;
}

.pcb-form-header h4 {
    font-family: var(--pcb-font-heading) !important;
    font-size: 18px;
    font-weight: 400;
    color: var(--pcb-text);
}

/* Form fields */
#pcb-form {
    padding: 12px 20px 24px;
    overflow: hidden;
}

.pcb-fields-row {
    display: flex;
    gap: 8px;
    margin-bottom: 0;
}

.pcb-fields-row .pcb-field {
    flex: 1;
    min-width: 0;
}

.pcb-field {
    position: relative;
    margin-bottom: 8px !important;
}

.pcb-field input,
.pcb-field textarea {
    width: 100%;
    padding: 0 14px !important;
    font-size: 14px;
    font-weight: 500;
    font-family: var(--pcb-font);
    color: var(--pcb-text);
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: var(--pcb-radius-sm);
    outline: none;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
    resize: none;
    -webkit-appearance: none;
    line-height: 1.4;
}

.pcb-field input {
    height: 40px !important;
}

.pcb-field textarea {
    min-height: 70px !important;
}

.pcb-field input::placeholder,
.pcb-field textarea::placeholder {
    color: var(--pcb-text-muted);
    font-weight: 400;
    opacity: 1;
}

/* Focus */
.pcb-field input:focus,
.pcb-field textarea:focus {
    border-color: var(--pcb-purple);
    background: rgba(111, 0, 255, 0.06);
    box-shadow: 0 0 0 3px rgba(111, 0, 255, 0.1);
}

/* Validation error */
.pcb-field.pcb-error input,
.pcb-field.pcb-error textarea {
    border-color: var(--pcb-danger);
    background: rgba(248, 113, 113, 0.06);
}

.pcb-field.pcb-error input::placeholder,
.pcb-field.pcb-error textarea::placeholder {
    color: var(--pcb-danger);
}

/* =========================================
   ACCEPTANCE CHECKBOX
   ========================================= */
.pcb-acceptance {
    margin-bottom: 16px !important;
    margin-top: 10px !important;
    padding-top: 4px;
}

.pcb-checkbox-wrap {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    position: relative;
}

.pcb-checkbox-wrap input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.pcb-checkmark {
    flex-shrink: 0;
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--pcb-text-dim);
    background: rgba(111, 0, 255, 0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s var(--pcb-transition);
    margin-top: 2px;
}

.pcb-checkmark svg {
    width: 13px;
    height: 13px;
    stroke: #fff;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s var(--pcb-transition);
}

.pcb-checkbox-wrap input:checked ~ .pcb-checkmark {
    background: var(--pcb-purple);
    border-color: var(--pcb-purple);
    box-shadow: 0 0 14px var(--pcb-purple-glow);
}

.pcb-checkbox-wrap input:checked ~ .pcb-checkmark svg {
    opacity: 1;
    transform: scale(1);
}

.pcb-acceptance-text {
    font-size: 10.5px;
    line-height: 1.55;
    color: var(--pcb-text-muted);
    font-weight: 400;
}

.pcb-acceptance.pcb-error .pcb-checkmark {
    border-color: var(--pcb-danger);
    box-shadow: 0 0 10px rgba(248, 113, 113, 0.2);
}

.pcb-acceptance.pcb-error .pcb-acceptance-text {
    color: var(--pcb-danger);
}

/* =========================================
   SUBMIT BUTTON
   ========================================= */
.pcb-submit {
    width: 100%;
    padding: 14px 24px !important;
    font-size: 16px;
    font-weight: 600;
    margin-top: 12px !important;
    font-family: var(--pcb-font);
    letter-spacing: 0.2px;
    color: #fff;
    background: var(--pcb-purple);
    border: 2px solid var(--pcb-purple);
    border-radius: 12px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.pcb-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.pcb-submit:hover {
    background: var(--pcb-purple-hover);
    border-color: var(--pcb-purple-hover);
    transform: translateY(-1px);
    box-shadow: 0 6px 24px rgba(111, 0, 255, 0.35);
}

.pcb-submit:hover::before {
    opacity: 0;
}

.pcb-submit:active {
    transform: translateY(0);
}

.pcb-submit-text,
.pcb-submit-loader {
    transition: all 0.3s ease;
}

.pcb-submit-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
}

.pcb-submit.pcb-loading .pcb-submit-text {
    opacity: 0;
    transform: translateY(8px);
}

.pcb-submit.pcb-loading .pcb-submit-loader {
    opacity: 1;
}

.pcb-submit.pcb-loading {
    pointer-events: none;
}

.pcb-spinner {
    width: 24px;
    height: 24px;
    animation: pcb-spin 0.8s linear infinite;
}

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

/* =========================================
   STEP 3: SUCCESS STATE
   ========================================= */
.pcb-success-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 32px 60px;
    min-height: 300px;
}

.pcb-success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 32px;
    color: var(--pcb-success);
    filter: drop-shadow(0 0 24px var(--pcb-success-glow));
}

.pcb-success-circle {
    stroke-dasharray: 226;
    stroke-dashoffset: 226;
    animation: pcb-drawCircle 0.6s ease-out 0.1s forwards;
}

.pcb-success-check {
    stroke-dasharray: 60;
    stroke-dashoffset: 60;
    animation: pcb-drawCheck 0.4s ease-out 0.5s forwards;
}

@keyframes pcb-drawCircle {
    to { stroke-dashoffset: 0; }
}

@keyframes pcb-drawCheck {
    to { stroke-dashoffset: 0; }
}

.pcb-success-content h3 {
    font-family: var(--pcb-font-heading) !important;
    font-size: 26px;
    font-weight: 400;
    color: var(--pcb-text);
    margin-bottom: 14px;
}

.pcb-success-content p {
    font-size: 14px;
    font-weight: 400;
    color: var(--pcb-text-muted);
    line-height: 1.7;
}

.pcb-success-content p strong {
    color: var(--pcb-yellow);
    font-weight: 600;
}

/* =========================================
   FIELD REVEAL ANIMATION (stagger via JS)
   ========================================= */

/* =========================================
   RESPONSIVE
   ========================================= */
@media (max-width: 480px) {
    #pcb-form-panel {
        width: calc(100vw - 16px);
        right: 8px;
        bottom: 100px;
        border-radius: 16px;
    }

    .pcb-form-inner {
        max-height: calc(100vh - 120px);
    }

    #pcb-bubble {
        bottom: 20px;
        right: 20px;
        width: 58px;
        height: 58px;
    }

    .pcb-icon {
        width: 24px;
        height: 24px;
    }

    .pcb-greeting-content {
        padding: 28px 22px 20px;
    }

    #pcb-go-form {
        width: calc(100% - 28px);
        margin: 0 14px 20px;
    }

    .pcb-form-header {
        padding: 16px 20px 10px;
    }

    #pcb-form {
        padding: 10px 20px 22px;
    }

    .pcb-fields-row {
        flex-direction: column;
        gap: 8px;
    }

    .pcb-field input {
        height: 50px;
    }

    .pcb-avatar-large {
        width: 68px;
        height: 68px;
    }
}

/* Help text under submit */
.pcb-help-text {
    text-align: center;
    font-size: 12px;
    color: var(--pcb-text-muted);
    margin-top: 12px !important;
    font-weight: 400;
    opacity: 0.7;
}

/* =========================================
   FLOATING BADGE — "Masz pytania? Napisz."
   ========================================= */
.pcb-badge {
    position: fixed;
    bottom: 40px;
    right: 102px;
    z-index: 999998;
    background: var(--pcb-navy-800);
    border: 1px solid rgba(111, 0, 255, 0.2);
    border-radius: 20px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    color: var(--pcb-text-muted);
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateX(8px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.pcb-badge::after {
    content: '';
    position: absolute;
    right: -6px;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
    height: 10px;
    background: var(--pcb-navy-800);
    border-right: 1px solid rgba(111, 0, 255, 0.2);
    border-top: 1px solid rgba(111, 0, 255, 0.2);
}

.pcb-badge.pcb-badge-show {
    opacity: 1;
    transform: translateX(0);
}

/* Hide badge when panel is open */
#pcb-bubble.pcb-open ~ .pcb-badge {
    opacity: 0 !important;
    transform: translateX(8px) !important;
}

/* ---- Particles (added via JS) ---- */
.pcb-particle {
    position: absolute;
    width: 4px;
    height: 4px;
    border-radius: 50%;
    pointer-events: none;
    opacity: 0;
}
