/* Floating "Schnelle Hilfe" button — links to the Hilfe-Center section on /mandanteninformationen/. */
a.hhp-help-fab {
    --fab-navy: #343E58;
    --fab-navy-deep: #262E43;
    --fab-accent: #5A78EF;
    --fab-lavender: #E9E9F3;
    --fab-size: 60px;
    --fab-ease: cubic-bezier(0.16, 1, 0.3, 1);

    position: fixed;
    right: max(24px, env(safe-area-inset-right));
    bottom: max(24px, env(safe-area-inset-bottom));
    z-index: 999; /* above the sticky header, below the Klaro consent modal */
    display: block;
    width: var(--fab-size);
    height: var(--fab-size);
    color: #ffffff !important;
    text-decoration: none !important;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.3s var(--fab-ease), transform 0.3s var(--fab-ease), visibility 0.3s;
}

/* ---- The round button ---------------------------------------------------- */
.hhp-help-fab__icon {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background:
        radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0) 58%),
        var(--fab-navy);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.14),
        0 2px 4px rgba(38, 46, 67, 0.18),
        0 10px 24px -6px rgba(38, 46, 67, 0.45);
    transition: background-color 0.35s var(--fab-ease), box-shadow 0.35s var(--fab-ease), transform 0.35s var(--fab-ease);
}

/* Lavender ring that sits just outside the button. */
.hhp-help-fab__icon::before {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: 50%;
    border: 1px solid rgba(90, 120, 239, 0.28);
    transition: inset 0.35s var(--fab-ease), border-color 0.35s var(--fab-ease);
}

/* Ripple used once by the first-visit peek. */
.hhp-help-fab__icon::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    border: 2px solid var(--fab-accent);
    opacity: 0;
    pointer-events: none;
}

.hhp-help-fab__icon svg {
    position: relative;
    width: 32px;
    height: 32px;
    display: block;
    transition: transform 0.45s var(--fab-ease);
}

/* ---- Label card (the tooltip) ------------------------------------------- */
.hhp-help-fab__label {
    position: absolute;
    right: calc(100% + 14px);
    top: 50%;
    display: flex;
    flex-direction: column;
    gap: 2px;
    padding: 11px 18px 12px;
    border-radius: 14px;
    background: var(--fab-navy);
    box-shadow:
        0 2px 4px rgba(38, 46, 67, 0.12),
        0 12px 28px -8px rgba(38, 46, 67, 0.4);
    white-space: nowrap;
    text-align: right;
    pointer-events: none;
    opacity: 0;
    transform: translate(8px, -50%);
    clip-path: inset(0 0 0 100% round 14px);
    transition:
        opacity 0.25s var(--fab-ease),
        transform 0.5s var(--fab-ease),
        clip-path 0.5s var(--fab-ease);
}

.hhp-help-fab__title {
    font-family: "ff-tisa-web-pro", Georgia, "Times New Roman", serif;
    font-size: 18px;
    line-height: 1.15;
    letter-spacing: 0.005em;
    color: #ffffff;
}

.hhp-help-fab__sub {
    font-family: "ff-tisa-sans-web-pro", "Helvetica Neue", Arial, sans-serif;
    font-size: 13px;
    line-height: 1.3;
    letter-spacing: 0.02em;
    color: #C9CEE6;
}

/* ---- States -------------------------------------------------------------- */
a.hhp-help-fab:hover .hhp-help-fab__icon,
a.hhp-help-fab:focus-visible .hhp-help-fab__icon {
    background-color: var(--fab-accent);
    background-image: radial-gradient(circle at 32% 26%, rgba(255, 255, 255, 0.22), rgba(255, 255, 255, 0) 58%);
    transform: translateY(-2px);
    box-shadow:
        inset 0 0 0 1px rgba(255, 255, 255, 0.18),
        0 3px 6px rgba(38, 46, 67, 0.16),
        0 16px 30px -8px rgba(90, 120, 239, 0.55);
}

a.hhp-help-fab:hover .hhp-help-fab__icon::before,
a.hhp-help-fab:focus-visible .hhp-help-fab__icon::before {
    inset: -8px;
    border-color: rgba(90, 120, 239, 0.45);
}

a.hhp-help-fab:hover .hhp-help-fab__icon svg,
a.hhp-help-fab:focus-visible .hhp-help-fab__icon svg {
    transform: rotate(-8deg) scale(1.04);
}

a.hhp-help-fab:hover .hhp-help-fab__label,
a.hhp-help-fab:focus-visible .hhp-help-fab__label,
a.hhp-help-fab.is-peeking .hhp-help-fab__label {
    opacity: 1;
    transform: translate(0, -50%);
    clip-path: inset(0 0 0 0 round 14px);
}

a.hhp-help-fab:focus {
    outline: none;
}

/* Keyboard focus: the outer ring becomes a solid focus indicator. */
a.hhp-help-fab:focus-visible .hhp-help-fab__icon::before {
    border: 2px solid var(--fab-accent);
}

a.hhp-help-fab:active .hhp-help-fab__icon {
    transform: translateY(0) scale(0.96);
}

/* First-visit peek: the label unfolds and one ripple leaves the button. */
a.hhp-help-fab.is-peeking .hhp-help-fab__icon::after {
    animation: hhp-help-fab-ripple 1.6s var(--fab-ease) 2;
}

@keyframes hhp-help-fab-ripple {
    0%   { opacity: 0.55; transform: scale(1); }
    100% { opacity: 0;    transform: scale(1.75); }
}

/* Hidden while the Hilfe-Center itself is on screen (toggled by hilfe-button.js). */
a.hhp-help-fab.is-hidden {
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px) scale(0.85);
}

@media (max-width: 767px) {
    a.hhp-help-fab {
        --fab-size: 54px;
        right: max(16px, env(safe-area-inset-right));
        bottom: max(16px, env(safe-area-inset-bottom));
    }

    .hhp-help-fab__icon svg {
        width: 29px;
        height: 29px;
    }

    .hhp-help-fab__title {
        font-size: 16px;
    }
}

@media (prefers-reduced-motion: reduce) {
    a.hhp-help-fab,
    .hhp-help-fab__icon,
    .hhp-help-fab__icon::before,
    .hhp-help-fab__icon svg,
    .hhp-help-fab__label {
        transition: none;
    }

    a.hhp-help-fab.is-peeking .hhp-help-fab__icon::after {
        animation: none;
    }

    a.hhp-help-fab:hover .hhp-help-fab__icon svg,
    a.hhp-help-fab:focus-visible .hhp-help-fab__icon svg {
        transform: none;
    }
}

@media print {
    a.hhp-help-fab {
        display: none;
    }
}

/* Hilfe-Center embed on /mandanteninformationen/ */
#hilfe-center-embed {
    padding: 0 20px 75px;
}

#hilfe-center-embed .elementor-container {
    display: block;
}
