/* ─── ChatBuddy Styles (Compact / Dichte-first) ─── */

.chatbuddy-panel {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s ease;
    will-change: transform, opacity;
}
.chatbuddy-submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
    background-size: 200% 100%;
    animation: chatbuddyShimmer 2.5s ease-in-out infinite;
}
@keyframes chatbuddyShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ─── Compact Topbar (replaces rail + header + thin track) ─── */
.cb-topbar {
    padding: 10px 16px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 1px solid var(--color-gray-100, #EFF1F4);
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    flex-shrink: 0;
}
.cb-topbar-avatar {
    width: 36px;
    height: 36px;
    border-radius: 9999px;
    overflow: hidden;
    flex-shrink: 0;
    background: linear-gradient(145deg, var(--color-arwa, #009AA6), var(--color-primary, #00245F));
    box-shadow: 0 4px 10px rgba(0, 154, 166, 0.2);
}
.cb-topbar-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.cb-topbar-meta {
    flex: 1;
    min-width: 0;
}
.cb-topbar-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--color-primary, #00245F);
    letter-spacing: -0.01em;
    line-height: 1.2;
}
.cb-topbar-sub {
    font-size: 11px;
    color: var(--color-gray-500, #6B7280);
    font-weight: 600;
    margin-top: 2px;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.2;
}
.cb-topbar-sub b {
    color: var(--color-primary, #00245F);
    font-weight: 700;
}
.cb-topbar-sub .sep {
    width: 3px;
    height: 3px;
    background: var(--color-gray-300, #D1D5DB);
    border-radius: 9999px;
    flex-shrink: 0;
}

/* Mini progress bar in topbar */
.cb-mini-progress {
    width: 60px;
    height: 4px;
    border-radius: 9999px;
    background: var(--color-gray-150, #E7EAEE);
    overflow: hidden;
    flex-shrink: 0;
}
.cb-mini-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--color-arwa-light, #5ED0D8), var(--color-arwa, #009AA6));
    border-radius: 9999px;
    transition: width 400ms cubic-bezier(0.23, 1, 0.32, 1);
}

.cb-topbar-close {
    width: 32px;
    height: 32px;
    border-radius: 9999px;
    background: var(--color-gray-100, #EFF1F4);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    color: var(--color-primary, #00245F);
    transition: background-color 180ms cubic-bezier(0.23, 1, 0.32, 1);
}
.cb-topbar-close:hover {
    background: var(--color-gray-200, #E3E7EC);
}
.cb-topbar-close svg {
    width: 12px;
    height: 12px;
}

/* ─── Step headline block (replaces bot-bubble) ─── */
.cb-step-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px 4px 8px;
    border-radius: 9999px;
    background: rgba(0, 154, 166, 0.08);
    color: var(--color-arwa-dark, #00245F);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-bottom: 12px;
}
.cb-step-chip::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 9999px;
    background: var(--color-arwa, #009AA6);
    box-shadow: 0 0 0 2px rgba(0, 154, 166, 0.2);
}
.cb-step-headline {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--color-primary, #00245F);
    margin-bottom: 8px;
}
.cb-step-headline em {
    font-style: normal;
    color: var(--color-arwa, #009AA6);
}
.cb-step-sub {
    font-size: 14px;
    color: var(--color-gray-500, #6B7280);
    line-height: 1.55;
    font-weight: 500;
    margin-bottom: 18px;
}

/* ─── Floating label input variant ─── */
.cb-float-field {
    position: relative;
}
.cb-float-field > label {
    position: absolute;
    top: 10px;
    left: 16px;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-gray-500, #6B7280);
    pointer-events: none;
    margin: 0;
    z-index: 1;
}
.cb-float-field > input,
.cb-float-field > select,
.cb-float-field > textarea {
    width: 100%;
    min-height: 60px;
    padding: 24px 16px 10px;
    background: var(--color-gray-50, #F7F8FA);
    border: 1px solid var(--color-gray-150, #E7EAEE);
    border-radius: 14px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 600;
    color: var(--color-primary, #00245F);
    outline: none;
    transition: border-color 200ms cubic-bezier(0.16, 1, 0.3, 1),
                background-color 200ms cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
    box-shadow: inset 0 1px 2px rgba(0, 36, 95, 0.02);
}
.cb-float-field > input::placeholder,
.cb-float-field > textarea::placeholder {
    color: var(--color-gray-400, #9CA3AF);
    font-weight: 500;
}
.cb-float-field > input:focus,
.cb-float-field > select:focus,
.cb-float-field > textarea:focus {
    border-color: var(--color-arwa, #009AA6);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 154, 166, 0.1);
}
.cb-float-field > input.error,
.cb-float-field > select.error,
.cb-float-field > textarea.error {
    border-color: #EF4444;
    background: #FEF2F2;
}
.cb-float-field > textarea {
    min-height: 96px;
    padding-top: 28px;
    resize: vertical;
}

/* Row split for Vor/Nachname + PLZ/Ort */
.cb-field-row-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

/* ─── Dense CTA with inner arrow chip ─── */
.cb-cta-dense {
    width: 100%;
    background: var(--color-primary, #00245F);
    color: #fff;
    border: none;
    border-radius: 14px;
    padding: 6px 6px 6px 22px;
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    cursor: pointer;
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.12),
        0 10px 30px -10px rgba(0, 36, 95, 0.45);
    transition: transform 200ms cubic-bezier(0.16, 1, 0.3, 1),
                box-shadow 200ms cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 52px;
}
.cb-cta-dense:hover:not(:disabled) {
    box-shadow:
        inset 0 1px 0 rgba(255,255,255,0.15),
        0 14px 36px -10px rgba(0, 36, 95, 0.55);
}
.cb-cta-dense:active:not(:disabled) {
    transform: scale(0.98);
}
.cb-cta-dense:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
.cb-cta-dense-label {
    flex: 1;
    text-align: left;
    letter-spacing: 0.01em;
}
.cb-cta-dense-arrow {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--color-arwa, #009AA6);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: inset 0 1px 0 rgba(255,255,255,0.2);
}
.cb-cta-dense-arrow svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
    stroke-width: 2;
    fill: none;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Secondary (Skip) button — subtle navy-on-grey */
.cb-cta-skip {
    width: 100%;
    background: transparent;
    color: var(--color-gray-500, #6B7280);
    border: 1px solid var(--color-gray-150, #E7EAEE);
    border-radius: 12px;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
    margin-top: 8px;
}
.cb-cta-skip:hover {
    background: var(--color-gray-50, #F7F8FA);
    color: var(--color-primary, #00245F);
    border-color: var(--color-gray-200, #E3E7EC);
}
.cb-cta-skip svg {
    width: 13px;
    height: 13px;
}

/* Back button — floats above CTA, subtle */
.cb-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    margin-bottom: 12px;
    border-radius: 10px;
    background: transparent;
    border: none;
    color: var(--color-gray-500, #6B7280);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
}
.cb-back-btn:hover {
    color: var(--color-arwa, #009AA6);
    background: var(--color-gray-50, #F7F8FA);
}
.cb-back-btn svg {
    width: 14px;
    height: 14px;
}

/* ─── Response bubble (shown after step completed) — lighter, aligned right ─── */
.cb-response-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    max-width: 85%;
    padding: 8px 8px 8px 14px;
    background: var(--color-arwa, #009AA6);
    color: #fff;
    border-radius: 14px;
    border-top-right-radius: 4px;
    box-shadow: var(--clay-shadow-pill, 0 1px 3px rgba(0, 154, 166, 0.2));
    font-size: 13px;
    font-weight: 500;
    margin-left: auto;
}
.cb-response-pill-edit {
    width: 24px;
    height: 24px;
    border-radius: 9999px;
    background: rgba(255,255,255,0.2);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    transition: background-color 150ms;
}
.cb-response-pill-edit:hover {
    background: rgba(255,255,255,0.3);
}
.cb-response-pill-edit svg {
    width: 11px;
    height: 11px;
}

/* Pill chips for Working Time / Interests (Step 4) — kept simple but aligned */
.cb-pill-chip {
    cursor: pointer;
    position: relative;
}
.cb-pill-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.cb-pill-chip-label {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    background: var(--color-gray-50, #F7F8FA);
    border: 1.5px solid var(--color-gray-150, #E7EAEE);
    border-radius: 9999px;
    font-size: 13px;
    font-weight: 600;
    color: var(--color-gray-700, #374151);
    transition: all 180ms cubic-bezier(0.16, 1, 0.3, 1);
    min-height: 40px;
}
.cb-pill-chip:hover .cb-pill-chip-label {
    background: var(--color-gray-100, #EFF1F4);
    border-color: var(--color-gray-200, #E3E7EC);
}
.cb-pill-chip input:checked + .cb-pill-chip-label {
    background: rgba(0, 154, 166, 0.1);
    color: var(--color-arwa, #009AA6);
    border-color: rgba(0, 154, 166, 0.4);
}

/* Chip-group label + optional marker */
.cb-pill-group-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--color-gray-500, #6B7280);
}
.cb-pill-group-optional {
    display: inline-block;
    padding: 2px 8px;
    background: var(--color-gray-100, #EFF1F4);
    color: var(--color-arwa, #009AA6);
    font-size: 10px;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: none;
    letter-spacing: 0;
}

/* ─── Form scroll area + sticky bottom bar ─── */
.cb-scroll {
    flex: 1;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 20px 16px 16px;
}
.cb-bottom-bar {
    padding: 12px 16px 16px;
    background: rgba(255,255,255,0.92);
    backdrop-filter: blur(16px);
    border-top: 1px solid var(--color-gray-100, #EFF1F4);
    flex-shrink: 0;
}

/* Safe area respect on iOS */
@supports (padding: env(safe-area-inset-bottom)) {
    .cb-bottom-bar {
        padding-bottom: calc(16px + env(safe-area-inset-bottom));
    }
}

/* Error text */
.cb-field-error {
    display: block;
    margin-top: 6px;
    padding: 0 4px;
    font-size: 11px;
    font-weight: 600;
    color: #EF4444;
    line-height: 1.3;
}
