/* static/css/style.css */

/* Grundfarben / Radii - ergaenzend zu colours_fonts.css */
:root {
    --sa-red: #b31217;
    --sa-red-dark: #920f13;
    --sa-surface: #ffffff;
    --sa-border: #ded4c9;
    --sa-text-main: #171717;
    --sa-text-muted: #666666;
    --sa-bg: #f4f1ec;
    --sa-radius-card: 0.9rem;
    --sa-radius-pill: 999px;
    --sa-shadow-soft: 0 6px 18px rgba(0, 0, 0, 0.10);
    --sa-shadow-soft-strong: 0 14px 32px rgba(0, 0, 0, 0.16);
    --ba-speed-fast: 0.12s;
    --ba-speed-base: 0.18s;
    --ba-speed-slow: 0.28s;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body.ba-body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
        "Segoe UI", sans-serif;
    font-size: 15px;
    line-height: 1.5;
    color: var(--sa-text-main);
    background: radial-gradient(circle at top left, #fdf8f3 0, var(--sa-bg) 42%, #ece5dd 100%);
    display: flex;
    flex-direction: column;
}

:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: none;
    box-shadow:
        0 0 0 2px rgba(255, 255, 255, 0.95),
        0 0 0 4px rgba(179, 18, 23, 0.55);
}

/* Header / Navigation */

.ba-header {
    background: linear-gradient(135deg, #c32b2c 0%, #8b0c11 95%);
    color: #fff;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.25);
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(16px);
}

.ba-header-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.7rem 1.8rem;
    display: flex;
    align-items: center;
    gap: 1.6rem;
}

/* Brand */

.ba-brand {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    flex-shrink: 0;
}

.ba-brand-mark {
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 0.9rem;
    background: rgba(255, 255, 255, 0.95);
    color: var(--sa-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

.ba-brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.12rem;
}

.ba-brand-title {
    font-weight: 600;
    font-size: 1.05rem;
    letter-spacing: 0.02em;
}

.ba-brand-sub {
    font-size: 0.78rem;
    opacity: 0.85;
}

/* Navigation */

.ba-nav {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    margin-left: auto;
}

.ba-nav-link {
    padding: 0.38rem 1rem;
    border-radius: var(--sa-radius-pill);
    font-size: 0.86rem;
    text-decoration: none;
    color: #ffecec;
    border: 1px solid transparent;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
    transition:
        background var(--ba-speed-base) ease,
        color var(--ba-speed-base) ease,
        border-color var(--ba-speed-base) ease,
        transform var(--ba-speed-fast) ease;
}

.ba-nav-link::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top left, rgba(255, 255, 255, 0.26), transparent 55%);
    opacity: 0;
    transition: opacity 0.15s ease;
}

.ba-nav-link:hover {
    background: rgba(255, 255, 255, 0.18);
    transform: translateY(-1px);
}

.ba-nav-link:hover::after {
    opacity: 1;
}

.ba-nav-link-active {
    background: #fff;
    color: var(--sa-red);
    border-color: rgba(0, 0, 0, 0.08);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
}

/* Header-Badge */

.ba-header-badge {
    margin-left: 0.9rem;
    padding: 0.4rem 0.9rem;
    border-radius: var(--sa-radius-pill);
    background: rgba(255, 247, 247, 0.95);
    color: #4b1b1b;
    font-size: 0.76rem;
    font-weight: 600;
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.18);
    white-space: nowrap;
}

/* Main + Footer */

.ba-main {
    flex: 1 1 auto;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 1.1rem 1.8rem 1.6rem;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Optional: generische "Karte" fuer Inhalte */
.ba-card {
    background: var(--sa-surface);
    border-radius: var(--sa-radius-card);
    border: 1px solid rgba(0, 0, 0, 0.03);
    box-shadow: var(--sa-shadow-soft);
    padding: 1.1rem 1.2rem;
}

/* Footer */

.ba-footer {
    border-top: 1px solid var(--sa-border);
    background: #f1ebe4;
    font-size: 0.8rem;
    color: var(--sa-text-muted);
}

.ba-footer-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0.6rem 1.8rem 0.9rem;
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
    justify-content: space-between;
    align-items: center;
}

.ba-footer-inner span {
    opacity: 0.9;
}

/* Footer-Link (z.B. Impressum) */

.ba-footer-link {
    text-decoration: none;
    color: var(--sa-text-muted);
    padding: 0.25rem 0.7rem;
    border-radius: var(--sa-radius-pill);
    border: 1px solid transparent;
    font-weight: 500;
    transition:
        background var(--ba-speed-base) ease,
        color var(--ba-speed-base) ease,
        border-color var(--ba-speed-base) ease;
}

.ba-footer-link:hover {
    background: #e8dfd5;
    border-color: rgba(0, 0, 0, 0.08);
    color: var(--sa-text-main);
}

/* Globaler Primaer-Button (wird auch in Analytics verwendet) */

.sa-button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.5rem 1.2rem;
    border-radius: var(--sa-radius-pill);
    background: var(--sa-red);
    color: #fff;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 10px 18px rgba(179, 18, 23, 0.4);
    border: none;
    cursor: pointer;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    transition:
        background var(--ba-speed-base) ease,
        box-shadow var(--ba-speed-base) ease,
        transform var(--ba-speed-fast) ease;
}

.sa-button-link:hover {
    background: var(--sa-red-dark);
    box-shadow: 0 14px 26px rgba(179, 18, 23, 0.45);
    transform: translateY(-1px);
}

.sa-button-link:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(179, 18, 23, 0.35);
}

/* Responsive Layout / Header */

@media (max-width: 960px) {
    .ba-header-inner {
        padding-inline: 1.2rem;
        gap: 0.9rem;
    }

    .ba-main {
        padding-inline: 1.2rem;
    }

    .ba-header-badge {
        display: none;
    }
}

@media (max-width: 700px) {
    .ba-header-inner {
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .ba-nav {
        margin-left: 0;
        width: 100%;
        justify-content: flex-start;
        flex-wrap: wrap;
        row-gap: 0.35rem;
    }

    .ba-main {
        padding-inline: 1rem;
        padding-top: 0.9rem;
    }

    .ba-footer-inner {
        padding-inline: 1rem;
    }
}

/* Onboarding overlay + info spot */

.ba-body-onb-lock {
    overflow: hidden;
    touch-action: none;
}

/* full screen dim layer, hidden by default */

#ba-onb-overlay {
    position: fixed;
    inset: 0;
    padding: 1.4rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle at top, rgba(0, 0, 0, 0.65) 0, rgba(0, 0, 0, 0.78) 45%, rgba(0, 0, 0, 0.86) 100%);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.18s ease;
}

.ba-onb-overlay-inner {
    width: 100%;
    max-width: 720px;
    max-height: 90vh;
    background: var(--sa-surface);
    border-radius: var(--sa-radius-card);
    border: 1px solid rgba(0, 0, 0, 0.06);
    box-shadow: var(--sa-shadow-soft-strong);
    padding: 1.2rem 1.4rem 1.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
    overflow: hidden;
}

.ba-onb-visible {
    opacity: 1;
    pointer-events: auto;
}

/* header + copy */

.ba-onb-header {
    margin-bottom: 0.1rem;
}

.ba-onb-title {
    margin: 0;
    font-size: 1.1rem;
    font-weight: 600;
}

.ba-onb-text {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    padding-right: 0.2rem;
    margin-right: -0.2rem;
}

.ba-onb-text p {
    margin: 0 0 0.4rem;
    font-size: 0.86rem;
    line-height: 1.5;
}

.ba-onb-text p:last-child {
    margin-bottom: 0;
}

.ba-onb-hint {
    margin-top: 0.25rem;
    font-size: 0.78rem;
    color: var(--sa-text-muted);
}

/* footer: progress + button */

.ba-onb-footer {
    margin-top: 0.55rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ba-onb-progress {
    position: relative;
    height: 0.45rem;
    border-radius: var(--sa-radius-pill);
    background: #f0e3d5;
    overflow: hidden;
}

.ba-onb-progress-bar {
    position: absolute;
    inset: 0;
    width: 0%;
    border-radius: var(--sa-radius-pill);
    background: linear-gradient(
        90deg,
        var(--sa-red) 0%,
        #f37b4b 55%,
        #ffd6a3 100%
    );
    transition: width 0.06s linear;
}

.ba-onb-footer-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.4rem;
    margin-top: 0.1rem;
}

.ba-onb-countdown {
    font-size: 0.78rem;
    color: var(--sa-text-muted);
}

/* primary action button */

.ba-onb-button {
    min-width: 7.5rem;
    padding: 0.4rem 1.1rem;
    border-radius: var(--sa-radius-pill);
    border: none;
    background: var(--sa-red);
    color: #ffffff;
    font-size: 0.82rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(179, 18, 23, 0.55);
    transition:
        background 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.08s ease,
        opacity 0.12s ease;
}

.ba-onb-button:hover {
    background: var(--sa-red-dark);
    box-shadow: 0 10px 24px rgba(179, 18, 23, 0.6);
    transform: translateY(-0.5px);
}

.ba-onb-button:active {
    transform: translateY(0);
    box-shadow: 0 6px 16px rgba(179, 18, 23, 0.45);
}

.ba-onb-button:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.2),
        0 0 0 4px rgba(179, 18, 23, 0.55);
}

/* disabled state while timer is running */

.ba-onb-button-disabled,
.ba-onb-button[disabled] {
    cursor: default;
    opacity: 0.6;
    box-shadow: none;
    background: #bfb6ad;
    color: #f5f2ee;
}

/* info spot icon bottom right */

.ba-onb-spot {
    position: fixed;
    right: 1.4rem;
    bottom: 1.4rem;
    width: 2.3rem;
    height: 2.3rem;
    border-radius: 999px;
    background: #ffffff;
    color: var(--sa-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.95rem;
    border: 1px solid rgba(0, 0, 0, 0.05);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.35);
    cursor: pointer;
    z-index: 1500;
    transition:
        transform 0.12s ease,
        box-shadow 0.12s ease,
        background 0.12s ease,
        color 0.12s ease;
}

.ba-onb-spot:hover {
    background: #fff7f7;
    color: var(--sa-red-dark);
    transform: translateY(-1px);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.45);
}

.ba-onb-spot:active {
    transform: translateY(0);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.3);
}

.ba-onb-spot:focus-visible {
    outline: 2px solid #ffffff;
    outline-offset: 2px;
    box-shadow:
        0 0 0 2px rgba(0, 0, 0, 0.3),
        0 0 0 4px rgba(179, 18, 23, 0.7);
}

/* halo animation around the spot */

.ba-onb-halo {
    position: fixed;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.9);
    box-shadow:
        0 0 0 3px rgba(179, 18, 23, 0.6),
        0 0 26px rgba(179, 18, 23, 0.8);
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
    z-index: 1400;
    transition:
        opacity 0.18s ease,
        transform 0.18s ease;
}

.ba-onb-halo-visible {
    opacity: 1;
    transform: scale(1);
}

/* small speech bubble pointing to the spot */

.ba-onb-spot-bubble {
    position: fixed;
    max-width: 280px;
    padding: 0.55rem 0.9rem;
    border-radius: 0.85rem;
    background: #fff7f5;
    color: #4b1b1b;
    font-size: 0.78rem;
    line-height: 1.45;
    box-shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(179, 18, 23, 0.28);
    z-index: 1600;
}

/* responsive tweaks for small screens */

@media (max-width: 640px) {
    #ba-onb-overlay {
        padding: 0.9rem;
    }

    .ba-onb-overlay-inner {
        padding: 1rem 1.05rem 0.95rem;
        max-width: 100%;
    }

    .ba-onb-title {
        font-size: 1.02rem;
    }

    .ba-onb-text p {
        font-size: 0.82rem;
    }

    .ba-onb-spot {
        right: 1rem;
        bottom: 1rem;
    }
}

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