/* ==========================================================
   TRACE5 – gemeinsame Bausteine für alle Seiten
   1. Mobile Navigation (Hamburger)
   2. Opt-in-Boxen (Newsletter / Lead Magnet / Warteliste)
   ========================================================== */

/* ---------- 1. Mobile Navigation ---------- */
.t5-burger {
    display: none;
    position: relative;
    width: 48px; height: 48px;
    margin-right: -10px;
    padding: 0; border: 0; background: none;
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
}
.nav.light .t5-burger { color: #2D3748; }
.t5-burger:focus-visible { outline: 2px solid #E8381A; outline-offset: 2px; }
.t5-burger span {
    position: absolute; left: 11px; height: 2px;
    background: currentColor;
    transition: transform .3s cubic-bezier(.7,0,.3,1), opacity .2s, width .3s, top .3s;
}
.t5-burger span:nth-child(1) { top: 16px; width: 26px; }
.t5-burger span:nth-child(2) { top: 23px; width: 26px; }
.t5-burger span:nth-child(3) { top: 30px; width: 15px; background: #E8381A; }
.t5-menu-open .t5-burger { color: #fff; }
.t5-menu-open .t5-burger span:nth-child(1) { top: 23px; transform: rotate(45deg); }
.t5-menu-open .t5-burger span:nth-child(2) { opacity: 0; }
.t5-menu-open .t5-burger span:nth-child(3) { top: 23px; width: 26px; transform: rotate(-45deg); }

.t5-mnav {
    position: fixed;
    inset: 0;
    z-index: 190;
    padding: 96px 24px 32px;
    background:
        linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 56px 56px,
        linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0 / 56px 56px,
        #111;
    color: #fff;
    display: flex; flex-direction: column;
    overflow-y: auto;
    overscroll-behavior: contain;
    visibility: hidden;
    opacity: 0;
    clip-path: inset(0 0 100% 0);
    transition: clip-path .45s cubic-bezier(.7,0,.3,1), opacity .2s .25s, visibility 0s .45s;
}
.t5-menu-open .t5-mnav {
    visibility: visible; opacity: 1;
    clip-path: inset(0 0 0 0);
    transition: clip-path .45s cubic-bezier(.7,0,.3,1), opacity 0s, visibility 0s;
}
/* Navigationsleiste bleibt über dem Menü sichtbar und wird dunkel */
.t5-menu-open .nav { background: #111 !important; border-bottom-color: rgba(255,255,255,.08) !important; }
.t5-menu-open .nav .nav__logo-dark { opacity: 1 !important; }
.t5-menu-open .nav .nav__logo-light { opacity: 0 !important; }
html.t5-menu-open, html.t5-menu-open body { overflow: hidden; }
.t5-menu-open #cookie-settings-btn, .t5-menu-open #t5-chat-widget { display: none !important; }

.t5-mnav__list { list-style: none; margin: 0; padding: 0; }
.t5-mnav__item {
    border-bottom: 1px solid rgba(255,255,255,.1);
    opacity: 0; transform: translateY(14px);
    transition: opacity .35s, transform .35s;
}
.t5-menu-open .t5-mnav__item { opacity: 1; transform: none; }
.t5-menu-open .t5-mnav__item:nth-child(1) { transition-delay: .15s; }
.t5-menu-open .t5-mnav__item:nth-child(2) { transition-delay: .2s; }
.t5-menu-open .t5-mnav__item:nth-child(3) { transition-delay: .25s; }
.t5-menu-open .t5-mnav__item:nth-child(4) { transition-delay: .3s; }
.t5-mnav__link {
    display: flex; align-items: baseline; gap: 14px;
    padding: 16px 0;
    font-family: 'Barlow Condensed', sans-serif;
    font-weight: 700;
    font-size: clamp(34px, 10vw, 46px);
    line-height: 1;
    letter-spacing: -.01em;
    text-transform: uppercase;
    color: #fff;
    text-decoration: none;
}
.t5-mnav__link::before {
    content: attr(data-nr);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px; font-weight: 500;
    letter-spacing: .08em;
    color: #E8381A;
    transform: translateY(-14px);
}
.t5-mnav__link[aria-current="page"] { color: #E8381A; }
.t5-mnav__sub { list-style: none; margin: -4px 0 0; padding: 0 0 16px 32px; }
.t5-mnav__sub a {
    display: block;
    padding: 9px 0;
    font-family: 'IBM Plex Serif', serif;
    font-size: 17px;
    color: rgba(255,255,255,.72);
    text-decoration: none;
}
.t5-mnav__sub a::before { content: '→ '; color: #E8381A; }
.t5-mnav__sub a[aria-current="page"] { color: #fff; }
.t5-mnav__foot {
    margin-top: auto;
    padding-top: 32px;
    display: flex; flex-direction: column; gap: 14px;
    opacity: 0; transition: opacity .35s .35s;
}
.t5-menu-open .t5-mnav__foot { opacity: 1; }
.t5-mnav__cta {
    display: block;
    padding: 18px 20px;
    background: #E8381A; color: #fff;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 15px; font-weight: 500;
    letter-spacing: .06em; text-transform: uppercase;
    text-align: center; text-decoration: none;
}
.t5-mnav__lang {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 13px; letter-spacing: .06em;
    color: rgba(255,255,255,.6);
    text-decoration: none; text-align: center;
}

@media (max-width: 900px) {
    .t5-burger { display: block; }
}
@media (min-width: 901px) {
    .t5-mnav { display: none; }
}

/* ---------- 2. Opt-ins ----------
   .t5-band  = rotes Band über die volle Breite, im Seitenraster (Hauptangebot)
   .t5-card  = weiße Karte mitten im Inhalt (Mitschrift, Kursseiten, Folgenliste)
   .t5-mini  = schmale Zeile im Podcast-Hero
   Alle tragen zusätzlich .t5-optin (Status-Klassen is-done / is-error). */

.t5-optin__hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.t5-optin__msg {
    display: none; margin: 14px 0 0; padding: 12px 14px;
    border-left: 3px solid #E8381A; background: #F7F7F5;
    font-family: 'IBM Plex Serif', serif; font-size: 15.5px; line-height: 1.5; color: #111;
}
.t5-optin.is-done .t5-optin__msg, .t5-optin.is-error .t5-optin__msg { display: block; }
.t5-optin.is-done .t5-optin__row, .t5-optin.is-done .t5-optin__legal { display: none; }
.t5-optin__legal {
    margin: 12px 0 0;
    font-family: 'IBM Plex Mono', monospace; font-size: 11.5px; line-height: 1.6; color: #8C8C8C;
}
.t5-optin__legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.t5-optin__row { display: flex; }
.t5-optin__input {
    flex: 1; min-width: 0; height: 56px; padding: 0 16px;
    border: 2px solid #111; border-right: 0; border-radius: 0;
    background: #fff; color: #111;
    font-family: 'IBM Plex Mono', monospace; font-size: 16px;
    -webkit-appearance: none; appearance: none;
}
.t5-optin__input::placeholder { color: #8C8C8C; }
.t5-optin__input:focus { outline: none; box-shadow: inset 0 0 0 2px #E8381A; }
.t5-optin__btn {
    height: 56px; padding: 0 24px;
    border: 2px solid #E8381A; border-radius: 0;
    background: #E8381A; color: #fff;
    font-family: 'IBM Plex Mono', monospace; font-size: 14px; font-weight: 500;
    letter-spacing: .06em; text-transform: uppercase; white-space: nowrap;
    cursor: pointer; transition: background .2s, border-color .2s, transform .15s;
}
.t5-optin__btn:hover { background: #111; border-color: #111; }
.t5-optin__btn:active { transform: translateY(1px); }
.t5-optin__btn:focus-visible { outline: 2px solid #111; outline-offset: 3px; }
.t5-optin__btn[disabled] { opacity: .6; cursor: wait; }
.t5-optin__tag {
    display: inline-block;
    font-family: 'IBM Plex Mono', monospace; font-size: 11px; font-weight: 500;
    letter-spacing: .1em; text-transform: uppercase;
    background: #E8381A; color: #fff; padding: 4px 9px;
}

/* --- Band --- */
.t5-band {
    position: relative; overflow: hidden;
    background:
        linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px) 0 0 / 80px 80px,
        linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px) 0 0 / 80px 80px,
        #E8381A;
    color: #fff;
    padding: clamp(64px, 9vw, 128px) 0;
}
.t5-band::after {
    content: 'T5'; position: absolute; left: -30px; bottom: -70px;
    font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
    font-size: clamp(220px, 28vw, 420px); line-height: 1; letter-spacing: -.04em;
    color: rgba(17,17,17,.07); pointer-events: none;
}
.t5-band__inner {
    position: relative; z-index: 1;
    max-width: 1480px; margin: 0 auto;
    padding: 0 clamp(20px, 5vw, 72px);
    display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr);
    gap: clamp(40px, 6vw, 112px); align-items: center;
}
.t5-band__eyebrow {
    display: flex; align-items: center; gap: 14px;
    font-family: 'IBM Plex Mono', monospace; font-size: 13px; font-weight: 500;
    letter-spacing: .1em; text-transform: uppercase; color: #111;
    margin: 0 0 22px;
}
.t5-band__eyebrow::after { content: ''; width: 48px; height: 2px; background: #111; }
.t5-band__title {
    font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
    font-size: clamp(44px, 6vw, 92px); line-height: .92; letter-spacing: -.01em;
    text-transform: uppercase; color: #fff; margin: 0 0 26px;
}
.t5-band__title em { font-style: normal; color: #111; }
.t5-band__text {
    font-family: 'IBM Plex Serif', serif; font-size: clamp(17px, 1.4vw, 20px); line-height: 1.6;
    color: rgba(255,255,255,.94); margin: 0; max-width: 54ch;
}
.t5-band__list { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 10px; }
.t5-band__list li {
    position: relative; padding-left: 34px;
    font-family: 'IBM Plex Mono', monospace; font-size: 15px; line-height: 1.5; color: #fff;
}
.t5-band__list li span {
    position: absolute; left: 0; top: 1px;
    font-size: 11px; font-weight: 500; color: #111; letter-spacing: .06em;
}
.t5-band__card {
    position: relative;
    background: #fff; color: #111;
    border: 2px solid #111;
    box-shadow: 14px 14px 0 #111;
    padding: clamp(26px, 3vw, 40px);
    transition: transform .7s cubic-bezier(.2,.8,.2,1), opacity .5s, box-shadow .5s .4s;
}
.t5-band__stamp {
    position: absolute; top: -34px; right: -22px;
    width: 96px; height: 96px; border-radius: 50%;
    background: #111; color: #fff;
    display: flex; align-items: center; justify-content: center; text-align: center;
    font-family: 'Barlow Condensed', sans-serif; font-weight: 700; font-size: 21px; line-height: .95;
    text-transform: uppercase; transform: rotate(12deg);
    box-shadow: 0 0 0 4px #E8381A;
}
.t5-band__card-title {
    font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
    font-size: clamp(28px, 2.4vw, 36px); line-height: 1; text-transform: uppercase;
    margin: 16px 0 8px;
}
.t5-band__meta {
    font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; line-height: 1.6; color: #2D3748;
    margin: 0 0 22px; padding-bottom: 18px; border-bottom: 1px solid #D2D2CE;
}
.t5-band__card .t5-optin__row { flex-direction: column; gap: 10px; }
.t5-band__card .t5-optin__input { flex: none; width: 100%; border-right: 2px solid #111; height: 58px; }
.t5-band__card .t5-optin__btn { height: 58px; width: 100%; font-size: 15px; }
.t5-band.t5-in-pending .t5-band__card { opacity: 0; transform: translate(48px, 0) rotate(2deg); box-shadow: 0 0 0 #111; }

/* --- Karte im Inhalt --- */
.t5-card {
    position: relative;
    background: #fff; color: #111;
    border: 2px solid #111;
    box-shadow: 9px 9px 0 #E8381A;
    padding: clamp(24px, 3vw, 36px);
    margin: clamp(36px, 6vh, 64px) 0;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: clamp(20px, 3vw, 40px); align-items: end;
    text-align: left;
    transition: transform .6s cubic-bezier(.2,.8,.2,1), opacity .5s, box-shadow .45s .3s;
}
.t5-card:last-child { margin-bottom: 0; }
.t5-card.t5-in-pending { opacity: 0; transform: translateY(26px); box-shadow: 0 0 0 #E8381A; }
.t5-card__title {
    font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
    font-size: clamp(28px, 2.8vw, 38px); line-height: .98; text-transform: uppercase;
    color: #111; margin: 14px 0 10px;
}
.t5-card__title em { font-style: normal; color: #E8381A; }
.t5-card__text { font-family: 'IBM Plex Serif', serif; font-size: 16px; line-height: 1.6; color: #2D3748; margin: 0; }
.t5-card--stack { grid-template-columns: minmax(0, 1fr); align-items: start; }
.t5-card--stack .t5-optin__row { max-width: 560px; }

/* --- Mini-Zeile im Hero --- */
.t5-mini { margin-top: 22px; }
.t5-mini__label {
    display: flex; align-items: center; gap: 10px;
    font-family: 'IBM Plex Mono', monospace; font-size: 12.5px; font-weight: 500;
    letter-spacing: .08em; text-transform: uppercase; color: #111; margin: 0 0 10px;
}
.t5-mini__label::before {
    content: ''; width: 8px; height: 8px; border-radius: 50%; background: #E8381A;
    animation: t5-pulse 2s infinite;
}
.t5-mini .t5-optin__input, .t5-mini .t5-optin__btn { height: 50px; }
.t5-mini .t5-optin__legal { margin-top: 8px; font-size: 11px; }
@keyframes t5-pulse {
    0% { box-shadow: 0 0 0 0 rgba(232,56,26,.55); }
    70% { box-shadow: 0 0 0 9px rgba(232,56,26,0); }
    100% { box-shadow: 0 0 0 0 rgba(232,56,26,0); }
}

@media (max-width: 960px) {
    .t5-band__inner { grid-template-columns: minmax(0, 1fr); }
    .t5-band__eyebrow::after { display: none; }
    .t5-band__card { box-shadow: 10px 10px 0 #111; margin-right: 10px; }
    .t5-band__stamp { width: 80px; height: 80px; font-size: 18px; top: -30px; right: -10px; }
    .t5-card { grid-template-columns: minmax(0, 1fr); box-shadow: 7px 7px 0 #E8381A; }
}
@media (max-width: 520px) {
    .t5-optin__row { flex-direction: column; gap: 8px; }
    .t5-optin__input { flex: none; width: 100%; border-right: 2px solid #111; }
    .t5-optin__btn { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
    .t5-band.t5-in-pending .t5-band__card, .t5-card.t5-in-pending { opacity: 1; transform: none; }
    .t5-mini__label::before { animation: none; }
}

/* ---------- 3. Kontaktformular ---------- */
.t5-kontakt__legal {
    margin: 4px 0 16px;
    font-family: 'IBM Plex Mono', monospace;
    font-size: 12px; line-height: 1.6;
    color: #8C8C8C;
}
.t5-kontakt__legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.t5-kontakt__msg:empty { display: none; }
.t5-kontakt__msg {
    margin: 16px 0 0;
    padding: 14px 16px;
    border-left: 3px solid #E8381A;
    background: rgba(232,56,26,.07);
    font-family: 'IBM Plex Serif', serif;
    font-size: 16px; line-height: 1.5;
    color: #111;
}
.t5-kontakt__msg.is-ok { border-left-color: #1F8A4C; background: rgba(31,138,76,.08); }
.form-field .is-invalid { border-color: #E8381A !important; box-shadow: 0 0 0 1px #E8381A; }
@media (prefers-reduced-motion: reduce) {
    .t5-mnav, .t5-mnav__item, .t5-burger span { transition: none !important; }
}

/* ---------- 4. Kleine Bewegungen ---------- */
/* Druck-Feedback auf den wichtigsten Buttons */
.btn-primary:active, .form-btn:active, .nav__cta:active, #t5-chat-toggle:active, .t5-optin__btn:active {
    transform: scale(0.97);
    transition-duration: 160ms;
    transition-timing-function: cubic-bezier(0.23, 1, 0.32, 1);
}
#t5-chat-toggle { transition: transform 160ms cubic-bezier(0.23, 1, 0.32, 1); }

/* Rückmeldung des Kontaktformulars blendet weich ein statt aufzuspringen */
.t5-kontakt__msg { transition: opacity 300ms cubic-bezier(0.23, 1, 0.32, 1), transform 300ms cubic-bezier(0.23, 1, 0.32, 1); }
@starting-style { .t5-kontakt__msg { opacity: 0; transform: translateY(8px); } }

/* FAQ und Kursmodule klappen weich auf (Browser ohne Unterstützung klappen wie bisher) */
@supports selector(::details-content) {
    .faq__item details, details.mod, details.faq { interpolate-size: allow-keywords; }
    .faq__item details::details-content, details.mod::details-content, details.faq::details-content {
        block-size: 0; overflow: clip; opacity: 0;
        transition: block-size 250ms cubic-bezier(0.23, 1, 0.32, 1), opacity 200ms ease-out, content-visibility 250ms allow-discrete;
    }
    .faq__item details[open]::details-content, details.mod[open]::details-content, details.faq[open]::details-content {
        block-size: auto; opacity: 1;
    }
}
@media (prefers-reduced-motion: reduce) {
    @starting-style { .t5-kontakt__msg { transform: none; } }
    .faq__item details::details-content, details.mod::details-content, details.faq::details-content {
        transition: opacity 200ms ease-out, content-visibility 200ms allow-discrete;
    }
}
