/**
 * BBF Kundenkonto - oeffentlicher Widerrufsbutton
 * Kleines Standalone-Stylesheet fuer Gast-/Checkout-ohne-Konto-Faelle.
 */

.bbf-withdrawal-public {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --bbf-withdrawal-edge-offset: max(1rem, env(safe-area-inset-bottom));
    --bbf-withdrawal-dialog-width: min(980px, calc(100vw - 2rem));
    --bbf-withdrawal-dialog-width: min(980px, calc(100svw - 2rem));
}

.bbf-withdrawal-public:not(.bbf-withdrawal-public--footer) {
    z-index: 2147483500;
}

.bbf-withdrawal-public--fixed-left,
.bbf-withdrawal-public--fixed-center,
.bbf-withdrawal-public--fixed-right {
    position: fixed;
    z-index: 2147483500;
}

.bbf-withdrawal-public--fixed-left {
    top: 50%;
    left: 0;
    transform: translateY(-50%);
}

.bbf-withdrawal-public--fixed-center {
    left: 50%;
    bottom: var(--bbf-withdrawal-edge-offset);
    transform: translateX(-50%);
}

.bbf-withdrawal-public--fixed-right {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.bbf-withdrawal-public--sticky-left,
.bbf-withdrawal-public--sticky-center,
.bbf-withdrawal-public--sticky-right {
    position: fixed;
    z-index: 2147483500;
    bottom: var(--bbf-withdrawal-edge-offset);
    width: min(100% - 2rem, 28rem);
    pointer-events: none;
}

.bbf-withdrawal-public--sticky-left {
    left: 1rem;
}

.bbf-withdrawal-public--sticky-center {
    left: 50%;
    transform: translateX(-50%);
}

.bbf-withdrawal-public--sticky-right {
    right: 1rem;
}

.bbf-withdrawal-public--sticky-left .bbf-withdrawal-public__trigger,
.bbf-withdrawal-public--sticky-center .bbf-withdrawal-public__trigger,
.bbf-withdrawal-public--sticky-right .bbf-withdrawal-public__trigger {
    width: 100%;
    pointer-events: auto;
}

.bbf-withdrawal-public--footer {
    position: static;
    z-index: auto;
    margin: 0;
}

.bbf-withdrawal-public-footer-slot {
    margin: 1rem 0;
}

.bbf-withdrawal-public--footer .bbf-withdrawal-public__trigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    max-width: 100%;
}

.bbf-withdrawal-public--open::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: 1059;
    background: rgba(3,7,18,0.58);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.bbf-withdrawal-public__trigger,
.bbf-withdrawal-public .bbf-btn {
    min-height: 44px;
    min-width: 44px;
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    font: inherit;
    font-weight: 700;
}

.bbf-withdrawal-public__trigger {
    padding: 0.7rem 1rem;
    background: #111827;
    color: #fff;
    box-shadow: 0 14px 34px rgba(17,24,39,0.24);
}

.bbf-withdrawal-public--fixed-left .bbf-withdrawal-public__trigger {
    border-radius: 0 8px 8px 0;
}

.bbf-withdrawal-public--fixed-right .bbf-withdrawal-public__trigger {
    border-radius: 8px 0 0 8px;
}

.bbf-withdrawal-public__trigger:hover {
    background: #000;
}

.bbf-withdrawal-public__trigger:focus-visible,
.bbf-withdrawal-public .bbf-btn:focus-visible,
.bbf-withdrawal-public__close:focus-visible,
.bbf-withdrawal-public .bbf-input:focus-visible,
.bbf-withdrawal-public__legal summary:focus-visible,
.bbf-withdrawal-public__privacy a:focus-visible {
    outline: 3px solid #fff200;
    outline-offset: 3px;
}

.bbf-withdrawal-public__dialog {
    width: var(--bbf-withdrawal-dialog-width);
    max-width: calc(100vw - 2rem);
    max-width: calc(100svw - 2rem);
    border: 0;
    border-radius: 10px;
    margin: 0;
    padding: 0;
    color: #1f2937;
    box-shadow: 0 24px 64px rgba(17,24,39,0.26);
    max-height: 86vh;
    max-height: min(86vh, calc(100dvh - 2rem));
    overflow: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.bbf-withdrawal-public__dialog[open] {
    display: block;
    position: fixed;
    inset: auto;
    top: 50%;
    left: 50%;
    margin: 0;
    z-index: 1060;
    max-height: 86vh;
    max-height: min(86vh, calc(100dvh - 2rem));
    overflow: auto;
    transform: translate(-50%, -50%);
}

.bbf-withdrawal-public__dialog::backdrop {
    background: rgba(3,7,18,0.58);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
}

.bbf-withdrawal-public__form {
    display: grid;
    gap: 1rem;
    padding: 1.5rem;
    min-width: 0;
}

.bbf-withdrawal-public__header {
    display: flex;
    align-items: start;
    justify-content: space-between;
    gap: 1rem;
}

.bbf-withdrawal-public__form h2 {
    margin: 0;
    font-size: 1.15rem;
    line-height: 1.3;
}

.bbf-withdrawal-public__close {
    flex: 0 0 auto;
    width: 2.25rem;
    height: 2.25rem;
    border: 0;
    border-radius: 999px;
    background: #f3f4f6;
    color: #111827;
    cursor: pointer;
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1;
}

.bbf-withdrawal-public__close:hover {
    background: #e5e7eb;
}

.bbf-withdrawal-public__process {
    display: grid;
    gap: 0.45rem;
    padding: 0.8rem;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f9fafb;
    color: #374151;
    font-size: 0.88rem;
    line-height: 1.45;
}

.bbf-withdrawal-public__process strong {
    color: #111827;
}

.bbf-withdrawal-public__process ol {
    margin: 0;
    padding-left: 1.1rem;
}

.bbf-withdrawal-public__legal {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.65rem;
}

.bbf-withdrawal-public__legal details {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #fff;
}

.bbf-withdrawal-public__legal summary {
    cursor: pointer;
    padding: 0.7rem 0.8rem;
    color: #111827;
    font-weight: 700;
}

.bbf-withdrawal-public__legal details[open] summary {
    background: #f9fafb;
}

.bbf-withdrawal-public__legal-text {
    display: grid;
    grid-column: 1 / -1;
    gap: 0.55rem;
    max-height: 260px;
    overflow: auto;
    padding: 0.8rem;
    border-top: 1px solid #e5e7eb;
    background: #fff;
    color: #374151;
    font-size: 0.86rem;
    line-height: 1.5;
}

.bbf-withdrawal-public__legal-text[hidden] {
    display: none;
}

.bbf-withdrawal-public__legal-text p {
    margin: 0;
}

.bbf-withdrawal-public__legal-link {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.bbf-withdrawal-public__form label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
    min-width: 0;
}

.bbf-withdrawal-public .bbf-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    min-height: 42px;
    padding: 0.6rem 0.7rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    color: #111827;
    font: inherit;
}

.bbf-withdrawal-public select.bbf-input {
    cursor: pointer;
}

.bbf-withdrawal-public .bbf-input:focus-visible {
    outline: 2px solid #111827;
    outline-offset: 2px;
}

.bbf-withdrawal-public textarea.bbf-input {
    resize: vertical;
}

.bbf-withdrawal-public__honeypot {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.bbf-withdrawal-public__privacy {
    margin: 0;
    color: #4b5563;
    font-size: 0.85rem;
    line-height: 1.45;
}

.bbf-withdrawal-public__confirm {
    grid-template-columns: auto 1fr;
    align-items: start;
    color: #111827;
    font-size: 0.92rem;
    line-height: 1.4;
}

.bbf-withdrawal-public__confirm input {
    width: 1.1rem;
    height: 1.1rem;
    margin: 0.12rem 0 0;
    accent-color: #111827;
}

.bbf-withdrawal-public__privacy a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.bbf-withdrawal-public__noscript {
    margin: 0.5rem 0 0;
    font-size: 0.9rem;
    line-height: 1.4;
}

.bbf-withdrawal-public__noscript a {
    color: inherit;
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 0.16em;
}

.bbf-withdrawal-public__noscript-form {
    display: grid;
    gap: 0.7rem;
    width: min(92vw, 440px);
    margin: 0.75rem;
    padding: 1rem;
    border-radius: 8px;
    background: #fff;
    color: #111827;
    box-shadow: 0 18px 42px rgba(17,24,39,0.18);
}

.bbf-withdrawal-public__noscript-form label {
    display: grid;
    gap: 0.35rem;
    font-weight: 600;
}

.bbf-withdrawal__actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.bbf-withdrawal-public .bbf-btn--primary {
    background: #111827;
    color: #fff;
    padding: 0.65rem 0.9rem;
}

.bbf-withdrawal-public .bbf-btn--ghost {
    background: #f3f4f6;
    color: #1f2937;
    padding: 0.65rem 0.9rem;
}

.bbf-withdrawal__status {
    min-height: 1.25rem;
    margin: 0;
    font-size: 0.92rem;
}

.bbf-text-danger {
    color: #b91c1c;
}

.bbf-text-success {
    color: #047857;
}

@media (max-width: 640px) {
    .bbf-withdrawal-public--fixed-left,
    .bbf-withdrawal-public--fixed-center,
    .bbf-withdrawal-public--fixed-right {
        left: 1rem;
        right: 1rem;
        top: auto;
        bottom: var(--bbf-withdrawal-edge-offset);
        transform: none;
    }

    .bbf-withdrawal-public--sticky-left,
    .bbf-withdrawal-public--sticky-center,
    .bbf-withdrawal-public--sticky-right {
        left: 1rem;
        right: 1rem;
        width: auto;
        transform: none;
    }

    .bbf-withdrawal-public:not(.bbf-withdrawal-public--footer) .bbf-withdrawal-public__trigger,
    .bbf-withdrawal-public .bbf-btn {
        width: 100%;
    }

    .bbf-withdrawal-public--footer .bbf-withdrawal-public__trigger {
        width: auto;
    }

    .bbf-withdrawal-public--fixed-left .bbf-withdrawal-public__trigger,
    .bbf-withdrawal-public--fixed-right .bbf-withdrawal-public__trigger {
        border-radius: 8px;
    }

    .bbf-withdrawal-public__dialog {
        width: calc(100vw - 1rem);
        width: calc(100svw - 1rem);
        max-height: min(92vh, calc(100dvh - 1rem));
        border-radius: 12px 12px 0 0;
    }

    .bbf-withdrawal-public__dialog[open] {
        top: auto;
        bottom: max(0.5rem, env(safe-area-inset-bottom));
        transform: translateX(-50%);
        max-height: min(92vh, calc(100dvh - 1rem));
    }

    .bbf-withdrawal-public__form {
        gap: 0.85rem;
        padding: 1rem;
    }

    .bbf-withdrawal-public__legal {
        grid-template-columns: 1fr;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bbf-withdrawal-public,
    .bbf-withdrawal-public *,
    .bbf-withdrawal-public *::before,
    .bbf-withdrawal-public *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
