/* =============================================================================================
   The welcome drop: our own consent banner (draft "Tropfen 3", 2026-10-25). A drop of light in the
   room, the same language as the drops of the pages (shared/site-drop.css): an aura, liquid light
   along the rim, a body of dark liquid with a pool of light, a breath of gloss. First view round on
   wide windows and a soft pebble on phones; the single choices as a taller pebble. On the legal
   texts a calm capsule at the bottom that does not lock the page. Markup: site_consent.php,
   behaviour: shared/consent.js. Motion only on transform and opacity; none under reduced motion.
   ============================================================================================= */

.consent {
    --c: var(--w-pearl);
    --d: min(580px, calc(100vw - 32px));

    width: var(--d);
    max-width: none;
    max-height: none;
    margin: auto;
    padding: 0;
    overflow: visible;
    border: 0;
    background: transparent;
    color: var(--fg);
    font-family: var(--font-text);
}

.consent::backdrop {
    background: radial-gradient(ellipse 80% 70% at 50% 46%, rgba(4, 6, 9, 0.38), rgba(4, 6, 9, 0.78));
}

.consent[open]::backdrop {
    animation: consent-dim 0.8s ease-out both;
}

/* --- The drop -------------------------------------------------------------------------------- */

.consent-drop {
    position: relative;
    isolation: isolate;
}

.consent--calm .consent-drop {
    border-radius: clamp(36px, 7vw, 64px);
}

.consent[data-view="choose"] .consent-drop {
    border-radius: clamp(36px, 7vw, 64px);
}

.consent[data-view="first"]:not(.consent--calm) .consent-drop {
    display: grid;
    place-items: center;
    aspect-ratio: 1;
    border-radius: 50%;
}

.consent-aura {
    position: absolute;
    inset: -16%;
    z-index: -2;
    border-radius: 50%;
    background: radial-gradient(closest-side, color-mix(in oklab, var(--c) 16%, transparent), color-mix(in oklab, var(--cyan) 5%, transparent) 60%, transparent);
    pointer-events: none;
}

.consent-skin,
.consent-body {
    border-radius: inherit;
}

.consent-skin {
    position: absolute;
    inset: -1.5px;
    z-index: -1;
    background: conic-gradient(from 210deg, transparent 0%, color-mix(in oklab, var(--c) 82%, white) 7%, transparent 20%, color-mix(in oklab, var(--cyan) 40%, transparent) 44%, transparent 60%, color-mix(in oklab, var(--c) 66%, white) 80%, transparent 93%);
    opacity: 0.7;
    pointer-events: none;
}

.consent-body {
    position: relative;
    width: 100%;
    height: 100%;
    background:
        radial-gradient(110% 60% at 50% 112%, color-mix(in oklab, var(--cyan) 14%, transparent), transparent 62%),
        radial-gradient(circle at 46% 34%, color-mix(in oklab, var(--c) 8%, #0b0e13) 0%, #07090d 56%, color-mix(in oklab, var(--c) 9%, #090c11) 84%, color-mix(in oklab, var(--c) 18%, #0d1219) 100%);
    box-shadow:
        inset 0 0 0 1px color-mix(in oklab, var(--c) 22%, transparent),
        inset 0 0 38px color-mix(in oklab, var(--c) 12%, transparent),
        0 40px 90px -30px rgba(0, 0, 0, 0.9);
}

.consent[data-view="choose"] .consent-body {
    max-height: calc(100svh - 24px);
    padding: 8px clamp(18px, 5vw, 48px);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-color: color-mix(in oklab, var(--c) 30%, transparent) transparent;
    scrollbar-width: thin;
}

.consent[data-view="first"]:not(.consent--calm) .consent-body {
    display: grid;
    place-items: center;
}

.consent-gloss {
    position: absolute;
    top: 5%;
    left: 14%;
    width: 44%;
    height: 22%;
    border-radius: 50%;
    background: radial-gradient(closest-side, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.015) 64%, transparent);
    rotate: -22deg;
    pointer-events: none;
}

/* --- Content --------------------------------------------------------------------------------- */

/* The kicker: a dot of light and a word in mono capitals (self-contained: the home page has no
   shared/site-drop.css). */
.consent-kicker {
    display: flex;
    gap: 10px;
    align-items: center;
    justify-content: center;
    margin: 0 0 10px;
    color: var(--fg-3);
    font-family: var(--font-data);
    font-size: 0.74rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.consent-kicker .sdot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: radial-gradient(circle at 38% 34%, #fff 0 10%, var(--c) 46%, color-mix(in oklab, var(--c) 30%, transparent));
    box-shadow: 0 0 12px color-mix(in oklab, var(--c) 60%, transparent);
}

.consent-view {
    display: grid;
    justify-items: center;
    width: min(100%, 410px);
    padding: 26px 0;
    text-align: center;
}

.consent-view[hidden] {
    display: none;
}

.consent-title {
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-size: clamp(1.7rem, 1.35rem + 1.2vw, 2.25rem);
    font-weight: 400;
    line-height: 1.08;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

.consent-title:focus {
    outline: none;
}

.consent-title--small {
    font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.9rem);
}

.consent-text {
    margin: 0 0 20px;
    color: var(--fg-2);
    font-size: 0.93rem;
    line-height: 1.55;
    text-wrap: pretty;
}

.consent-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    width: min(100%, 380px);
}

.consent-actions--three {
    grid-template-columns: 1fr 1fr 1fr;
    width: 100%;
}

/* Every answer weighs the same: one shape, one light (no answer is pushed). */
.consent-btn {
    min-height: 50px;
    padding: 0 18px;
    border: 1px solid color-mix(in oklab, var(--c) 34%, transparent);
    border-radius: 999px;
    background: color-mix(in oklab, var(--c) 9%, rgba(7, 9, 13, 0.6));
    color: var(--fg);
    font: 600 0.95rem/1.2 var(--font-text);
    cursor: pointer;
    transition: transform 0.35s var(--ease-out), border-color 0.25s ease, background-color 0.25s ease;
    -webkit-tap-highlight-color: transparent;
}

@media (hover: hover) {
    .consent-btn:hover {
        border-color: color-mix(in oklab, var(--c) 70%, transparent);
        background: color-mix(in oklab, var(--c) 16%, rgba(7, 9, 13, 0.6));
        transform: translateY(-2px);
    }
}

.consent-btn:active {
    transform: scale(0.97);
}

.consent-more {
    min-height: 44px;
    margin-top: 6px;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: none;
    color: var(--fg-2);
    font: 500 0.92rem/1.2 var(--font-text);
    text-decoration: underline;
    text-decoration-color: color-mix(in oklab, var(--fg-2) 40%, transparent);
    text-underline-offset: 4px;
    cursor: pointer;
}

.consent-more:hover {
    color: var(--fg);
}

.consent-links {
    display: flex;
    gap: 18px;
    justify-content: center;
    margin: 4px 0 0;
    font-size: 0.82rem;
}

.consent-links a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    color: var(--fg-3);
    text-decoration: underline;
    text-decoration-color: color-mix(in oklab, var(--fg-3) 45%, transparent);
    text-underline-offset: 3px;
}

.consent-links a:hover {
    color: var(--fg);
}

.consent :focus-visible {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

/* The title takes the focus when the drop opens (screen readers start there); it shows no ring. */
.consent .consent-title:focus-visible {
    outline: none;
}

/* --- The single choices ---------------------------------------------------------------------- */

.consent[data-view="choose"] {
    --d: min(640px, calc(100vw - 24px));
}

.consent-choose {
    width: 100%;
    margin: 0 auto;
}

.consent-purposes {
    display: grid;
    gap: 2px;
    width: 100%;
    margin: 0 0 18px;
    padding: 0;
    list-style: none;
    text-align: left;
}

.consent-purpose label,
.consent-purpose.is-fixed {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 14px;
    align-items: start;
    min-height: 44px;
    padding: 12px 14px;
    border-radius: 22px;
    cursor: pointer;
    transition: background-color 0.25s ease;
}

.consent-purpose.is-fixed {
    cursor: default;
}

@media (hover: hover) {
    .consent-purpose label:hover {
        background: color-mix(in oklab, var(--c) 6%, transparent);
    }
}

.consent-purpose input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.consent-purpose-words {
    display: grid;
    gap: 3px;
}

.consent-purpose-name {
    font-weight: 600;
    font-size: 0.97rem;
}

.consent-purpose-text {
    color: var(--fg-2);
    font-size: 0.86rem;
    line-height: 1.5;
    text-wrap: pretty;
}

/* A switch: a round light in a channel, it travels to the right and lights up when on. */
.consent-switch {
    position: relative;
    display: block;
    width: 46px;
    height: 26px;
    margin-top: 1px;
    border: 1px solid color-mix(in oklab, var(--c) 30%, transparent);
    border-radius: 999px;
    background: rgba(7, 9, 13, 0.7);
    transition: border-color 0.25s ease, background-color 0.25s ease;
}

.consent-switch::after {
    content: "";
    position: absolute;
    top: 3px;
    left: 3px;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: color-mix(in oklab, var(--c) 46%, #2b3038);
    transition: transform 0.35s var(--ease-out), background-color 0.25s ease, box-shadow 0.25s ease;
}

.consent-purpose input:checked + .consent-switch,
.consent-switch.is-on {
    border-color: color-mix(in oklab, var(--cyan) 70%, transparent);
    background: color-mix(in oklab, var(--cyan) 22%, rgba(7, 9, 13, 0.7));
}

.consent-purpose input:checked + .consent-switch::after,
.consent-switch.is-on::after {
    background: radial-gradient(circle at 38% 34%, #fff 0 18%, var(--cyan) 64%);
    box-shadow: 0 0 12px color-mix(in oklab, var(--cyan) 70%, transparent);
    transform: translateX(20px);
}

.consent-switch.is-on {
    opacity: 0.6;
}

.consent-purpose input:focus-visible + .consent-switch {
    outline: 2px solid var(--focus);
    outline-offset: 3px;
}

/* --- Calm: the legal texts (the page stays readable and usable) ------------------------------ */

.consent--calm {
    --d: min(820px, calc(100vw - 24px));
}

.consent--calm:not(:modal) {
    position: fixed;
    inset: auto 0 max(12px, env(safe-area-inset-bottom));
    z-index: 900;
}

.consent--calm .consent-first {
    grid-template-columns: 1fr auto;
    gap: 6px 28px;
    align-items: center;
    width: 100%;
    padding: 20px clamp(18px, 4vw, 40px);
    text-align: left;
}

.consent--calm .consent-first > * {
    grid-column: 1;
}

.consent--calm .consent-first .consent-kicker {
    justify-content: start;
    margin-bottom: 0;
}

.consent--calm .consent-first .consent-title {
    margin: 0;
    font-size: 1.35rem;
}

.consent--calm .consent-first .consent-text {
    margin: 0;
    font-size: 0.86rem;
}

.consent--calm .consent-first .consent-actions {
    grid-row: 1 / span 3;
    grid-column: 2;
    grid-template-columns: 1fr;
    width: 210px;
}

/* The last row holds both columns: the links under the text, "Auswählen" under the answers. */
.consent--calm .consent-first .consent-more {
    grid-row: 4;
    grid-column: 2;
    justify-self: center;
}

.consent--calm .consent-first .consent-links {
    grid-row: 4;
    grid-column: 1;
    justify-content: start;
    justify-self: start;
}

.consent--calm .consent-aura {
    inset: -10% -4%;
    opacity: 0.6;
}

/* --- Phones: a soft pebble instead of the circle --------------------------------------------- */

@media (max-width: 560px) {
    .consent[data-view="first"]:not(.consent--calm) .consent-drop {
        aspect-ratio: auto;
        border-radius: 46% 46% 42% 42% / 30% 30% 26% 26%;
    }

    .consent-view {
        padding: 46px 26px 34px;
    }

    .consent-actions--three {
        grid-template-columns: 1fr;
    }

    .consent--calm .consent-first {
        grid-template-columns: 1fr;
        padding: 18px 20px;
        text-align: center;
    }

    .consent--calm .consent-first > *,
    .consent--calm .consent-first .consent-actions,
    .consent--calm .consent-first .consent-more,
    .consent--calm .consent-first .consent-links {
        grid-row: auto;
        grid-column: 1;
    }

    .consent--calm .consent-first .consent-kicker,
    .consent--calm .consent-first .consent-links {
        justify-content: center;
        justify-self: center;
    }

    .consent--calm .consent-first .consent-actions {
        grid-template-columns: 1fr 1fr;
        width: 100%;
    }
}

@media (max-width: 380px) {
    .consent-actions {
        grid-template-columns: 1fr;
    }
}

/* --- Motion: the drop rises out of the depth; the room dims a little ------------------------- */

@media (prefers-reduced-motion: no-preference) {
    .consent[open] .consent-drop {
        animation: consent-rise 0.9s var(--ease-out) both;
    }

    .consent[open] .consent-aura {
        animation: consent-glow 1.6s ease-out both;
    }

    .consent[open] .consent-view:not([hidden]) {
        animation: consent-words 0.7s var(--ease-out) 0.18s both;
    }
}

@keyframes consent-rise {
    from {
        opacity: 0;
        transform: translateY(22px) scale(0.9);
    }
}

@keyframes consent-glow {
    from {
        opacity: 0;
        transform: scale(0.82);
    }
}

@keyframes consent-words {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
}

@keyframes consent-dim {
    from {
        opacity: 0;
    }
}

/* The footer's button that opens the choice again looks like the links beside it
   (shared/site-theme.css styles .site-footer-links a and this button alike). */
.site-footer-consent {
    border: 0;
    background: none;
    font: inherit;
    cursor: pointer;
}
