/* t-be.de Portal — dunkles Neon-Design
   Farben: Petrolblau #005a87 (Verläufe/Glow), Magenta #ff08e8 (Akzent) */
:root {
    --blue: #005a87;
    --blue-light: #1b8fc7;
    --magenta: #ff08e8;
    --bg: #070b14;
    --glass: rgba(255, 255, 255, .045);
    --glass-strong: rgba(255, 255, 255, .08);
    --stroke: rgba(255, 255, 255, .09);
    --text: #eef2f8;
    --muted: #8d98ab;
    --danger: #ff5470;
    --radius: 18px;
    --grad: linear-gradient(120deg, var(--blue-light) 0%, var(--magenta) 100%);
    --font: "Inter", "Segoe UI Variable", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { background: var(--bg); }

body {
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

/* --- Hintergrund: wabernde Farbflächen + feines Raster ------------------ */
.bg {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    background: var(--bg);
}

.bg::after {  /* feines Punktraster */
    content: "";
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .06) 1px, transparent 1px);
    background-size: 28px 28px;
    mask-image: radial-gradient(ellipse at center, #000 30%, transparent 80%);
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: .55;
    animation: drift 22s ease-in-out infinite alternate;
}

.blob-1 { width: 42rem; height: 42rem; background: var(--blue); top: -14rem; left: -12rem; }
.blob-2 { width: 34rem; height: 34rem; background: var(--magenta); bottom: -16rem; right: -10rem; opacity: .35; animation-delay: -8s; }
.blob-3 { width: 22rem; height: 22rem; background: #3a1d8f; top: 40%; left: 55%; opacity: .35; animation-delay: -15s; }

@keyframes drift {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(6rem, 3rem) scale(1.12); }
    100% { transform: translate(-3rem, 6rem) scale(.95); }
}

@media (prefers-reduced-motion: reduce) {
    .blob { animation: none; }
    * { transition: none !important; }
}

/* --- Logo --------------------------------------------------------------- */
.logo {
    display: inline-flex;
    align-items: center;
    gap: .55rem;
    font-weight: 800;
    font-size: 1.15rem;
    letter-spacing: -.02em;
    color: var(--text);
    text-decoration: none;
}

.logo-mark {
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 10px;
    background: var(--grad);
    display: grid;
    place-items: center;
    font-size: .95rem;
    color: #fff;
    box-shadow: 0 0 24px rgba(255, 8, 232, .45);
}

.logo b { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* --- Glas-Karte ----------------------------------------------------------- */
.glass {
    background: var(--glass);
    border: 1px solid var(--stroke);
    border-radius: var(--radius);
    backdrop-filter: blur(18px) saturate(140%);
    -webkit-backdrop-filter: blur(18px) saturate(140%);
    box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
}

/* --- Formulare ------------------------------------------------------------ */
.field {
    width: 100%;
    padding: .85rem 1rem;
    border-radius: 12px;
    border: 1px solid var(--stroke);
    background: rgba(0, 0, 0, .3);
    color: var(--text);
    font: inherit;
    font-size: 1rem;
    transition: border-color .2s, box-shadow .2s;
}

.field::placeholder { color: #5f6b7e; }

.field:focus {
    outline: none;
    border-color: var(--magenta);
    box-shadow: 0 0 0 4px rgba(255, 8, 232, .15);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    padding: .85rem 1.4rem;
    border: 0;
    border-radius: 12px;
    background: var(--grad);
    background-size: 160% 100%;
    color: #fff;
    font: inherit;
    font-weight: 650;
    font-size: 1rem;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(255, 8, 232, .28);
    transition: background-position .4s, transform .15s, box-shadow .2s;
}

.btn:hover { background-position: 100% 0; box-shadow: 0 10px 34px rgba(255, 8, 232, .45); }
.btn:active { transform: translateY(1px); }

.btn-ghost {
    background: var(--glass-strong);
    border: 1px solid var(--stroke);
    box-shadow: none;
    font-weight: 500;
    font-size: .85rem;
    padding: .45rem .9rem;
}

.btn-ghost:hover { border-color: var(--magenta); box-shadow: 0 0 18px rgba(255, 8, 232, .25); }

.btn-danger { background: linear-gradient(120deg, #ff5470, #c2185b); box-shadow: 0 8px 28px rgba(255, 84, 112, .25); }

/* --- Login / Einrichtung -------------------------------------------------- */
.auth {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 1.5rem;
}

.auth-card {
    width: 100%;
    max-width: 24rem;
    padding: 2.4rem 2rem 2rem;
    text-align: center;
    animation: rise .6s cubic-bezier(.2, .8, .2, 1);
}

.auth-card .logo { font-size: 1.5rem; margin-bottom: 1.6rem; }
.auth-card .logo-mark { width: 2.8rem; height: 2.8rem; font-size: 1.2rem; border-radius: 13px; }

.auth-title { font-size: 1.35rem; font-weight: 700; letter-spacing: -.02em; margin-bottom: .3rem; }
.auth-sub { color: var(--muted); font-size: .92rem; margin-bottom: 1.6rem; }

.auth-card form { display: flex; flex-direction: column; gap: .8rem; }
.auth-card .btn { margin-top: .3rem; }

.alert {
    padding: .7rem .9rem;
    border-radius: 12px;
    font-size: .9rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 84, 112, .4);
    background: rgba(255, 84, 112, .1);
    color: #ffb3c0;
}

.alert-ok {
    border-color: rgba(27, 143, 199, .5);
    background: rgba(27, 143, 199, .12);
    color: #b9e6ff;
}

.auth-hint { color: var(--muted); font-size: .78rem; margin-top: 1.4rem; }

@keyframes rise {
    from { opacity: 0; transform: translateY(16px) scale(.98); }
    to   { opacity: 1; transform: none; }
}

/* --- App-Layout (Dashboard, Einstellungen) -------------------------------- */
.shell { max-width: 1080px; margin: 0 auto; padding: 1.4rem 1.4rem 3rem; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .7rem .8rem .7rem 1rem;
    margin-bottom: 2.6rem;
}

.nav { display: flex; gap: .4rem; flex-wrap: wrap; }

.nav a {
    color: var(--muted);
    text-decoration: none;
    font-size: .88rem;
    padding: .45rem .9rem;
    border-radius: 10px;
    transition: color .2s, background .2s;
}

.nav a:hover, .nav a.active { color: var(--text); background: var(--glass-strong); }

.hero { margin-bottom: 2.2rem; animation: rise .6s cubic-bezier(.2, .8, .2, 1); }

.hero-date {
    color: var(--muted);
    font-size: .8rem;
    font-weight: 600;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.hero h1 {
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 800;
    letter-spacing: -.035em;
    line-height: 1.1;
    margin-top: .3rem;
}

.hero h1 span { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }

.hero p { color: var(--muted); margin-top: .5rem; }

.section-title {
    font-size: .78rem;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--muted);
    margin-bottom: .9rem;
}

/* --- Kacheln -------------------------------------------------------------- */
.tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
    gap: 1rem;
}

.tile {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: .35rem;
    padding: 1.4rem;
    text-decoration: none;
    color: var(--text);
    overflow: hidden;
    transition: transform .25s cubic-bezier(.2, .8, .2, 1), border-color .25s, box-shadow .25s;
    animation: rise .6s cubic-bezier(.2, .8, .2, 1) backwards;
}

.tile:nth-child(2) { animation-delay: .06s; }
.tile:nth-child(3) { animation-delay: .12s; }
.tile:nth-child(4) { animation-delay: .18s; }
.tile:nth-child(n+5) { animation-delay: .24s; }

.tile::before {  /* Leuchten beim Überfahren */
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(28rem circle at 0% 0%, rgba(255, 8, 232, .16), transparent 45%);
    opacity: 0;
    transition: opacity .3s;
    pointer-events: none;
}

a.tile:hover {
    transform: translateY(-4px);
    border-color: rgba(255, 8, 232, .45);
    box-shadow: 0 18px 50px rgba(255, 8, 232, .18), 0 0 0 1px rgba(255, 8, 232, .15);
}

a.tile:hover::before { opacity: 1; }

.tile-icon {
    width: 3rem;
    height: 3rem;
    display: grid;
    place-items: center;
    font-size: 1.5rem;
    border-radius: 14px;
    background: linear-gradient(135deg, rgba(0, 90, 135, .55), rgba(255, 8, 232, .35));
    border: 1px solid var(--stroke);
    margin-bottom: .6rem;
}

.tile-name { font-weight: 700; font-size: 1.08rem; letter-spacing: -.01em; }
.tile-desc { color: var(--muted); font-size: .88rem; }

.tile-host {
    margin-top: .7rem;
    font-size: .75rem;
    color: #6f7b8f;
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
}

.tile-arrow {
    position: absolute;
    top: 1.3rem;
    right: 1.3rem;
    color: var(--muted);
    transition: transform .25s, color .25s;
}

a.tile:hover .tile-arrow { color: var(--magenta); transform: translate(3px, -3px); }

.tile-empty {
    border-style: dashed;
    background: transparent;
    backdrop-filter: none;
    box-shadow: none;
    opacity: .6;
}

.tile-empty .tile-icon { background: transparent; }

/* --- Einstellungen -------------------------------------------------------- */
.cards { display: grid; gap: 1rem; }

.card { padding: 1.5rem; }
.card h2 { font-size: 1.1rem; font-weight: 700; letter-spacing: -.01em; margin-bottom: .3rem; }
.card .hint { color: var(--muted); font-size: .88rem; }

.form-grid {
    display: grid;
    gap: .8rem;
    margin-top: 1.1rem;
    max-width: 26rem;
}

.form-grid label { display: grid; gap: .35rem; font-size: .85rem; color: var(--muted); }
.form-grid .btn { justify-self: start; }

.table { width: 100%; border-collapse: collapse; margin-top: 1rem; font-size: .9rem; }
.table th { text-align: left; color: var(--muted); font-weight: 500; font-size: .8rem; }
.table th, .table td { padding: .6rem .5rem; border-bottom: 1px solid var(--stroke); }

code {
    font-family: ui-monospace, "Cascadia Code", Consolas, monospace;
    font-size: .88em;
    padding: .1rem .4rem;
    border-radius: 6px;
    background: rgba(255, 255, 255, .07);
}

.footer {
    text-align: center;
    color: #5a6577;
    font-size: .78rem;
    margin-top: 3rem;
}

@media (max-width: 560px) {
    .topbar { flex-wrap: wrap; }
    .logo-text { display: none; }
}

/* =========================================================================
   Mathe-Blätter: Ergänzungen zum Portal-Design
   ========================================================================= */
.muted { color: var(--muted); }
.hero-zeile { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.card + .card, form.neu > .card + .card { margin-top: 1rem; }
.card.leer { text-align: center; display: grid; gap: 1rem; justify-items: center; padding: 3rem 1.5rem; }
.card h2 { display: flex; align-items: center; gap: .6rem; }
.hint { margin-top: .6rem; }
a { color: #9fd8ff; }

.btn-zweit { background: linear-gradient(120deg, var(--blue), var(--blue-light)); box-shadow: 0 8px 28px rgba(27, 143, 199, .25); }
.btn-klein { font-size: .85rem; padding: .45rem .9rem; }
.btn-gross { font-size: 1.1rem; padding: 1rem 2.2rem; }

/* Liste */
.blatt-tabelle td { vertical-align: middle; }
.blatt-tabelle a:not(.btn) { color: var(--text); font-weight: 600; text-decoration: none; }
.blatt-tabelle a:not(.btn):hover { color: var(--magenta); }
.blatt-tabelle .ops { font-size: 1.1rem; font-weight: 700; letter-spacing: .15em; white-space: nowrap; }
.aktionen { display: flex; gap: .4rem; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.aktionen form { display: inline; }
small { color: var(--muted); font-size: .78rem; }

/* Formular „Neues Blatt“ */
.schritt {
    display: inline-grid; place-items: center; width: 1.8rem; height: 1.8rem; border-radius: 50%;
    background: var(--grad); font-size: .9rem; color: #fff; box-shadow: 0 0 16px rgba(255, 8, 232, .35);
}
.segmente { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1rem; }
.segment input, .chip input, .thema-karte input { position: absolute; opacity: 0; pointer-events: none; }
.segment span, .chip span {
    display: inline-block; padding: .65rem 1.3rem; border-radius: 12px; cursor: pointer;
    border: 1px solid var(--stroke); background: rgba(0, 0, 0, .25); transition: all .2s; font-weight: 600;
}
.chip span { padding: .4rem .8rem; font-size: .9rem; border-radius: 10px; }
.segment input:checked + span, .chip input:checked + span {
    background: var(--grad); border-color: transparent; box-shadow: 0 6px 20px rgba(255, 8, 232, .3);
}
.segment input:focus-visible + span, .chip input:focus-visible + span,
.thema-karte input:focus-visible ~ span { outline: 2px solid var(--magenta); outline-offset: 2px; }

.gruppen { display: grid; grid-template-columns: repeat(auto-fit, minmax(22rem, 1fr)); gap: 1rem; margin-top: 1rem; }
.gruppe { border: 1px solid var(--stroke); border-radius: 14px; padding: .8rem 1rem 1rem; background: rgba(0, 0, 0, .18); }
.gruppe legend { padding: 0 .4rem; font-weight: 700; display: flex; align-items: center; gap: .4rem; }
.op-zeichen {
    display: inline-grid; place-items: center; width: 1.7rem; height: 1.7rem; border-radius: 8px;
    background: linear-gradient(135deg, rgba(0, 90, 135, .7), rgba(255, 8, 232, .45)); font-size: 1.05rem;
}
.typ {
    display: grid; grid-template-columns: auto 1fr auto; gap: .6rem; align-items: center;
    padding: .45rem .5rem; border-radius: 10px; cursor: pointer; transition: background .15s;
}
.typ:hover { background: var(--glass-strong); }
.typ input { width: 1.1rem; height: 1.1rem; accent-color: var(--magenta); }
.typ-text { font-size: .92rem; display: grid; }
.typ-text small { font-size: .78rem; }
.typ-kl { font-size: .72rem; color: var(--muted); border: 1px solid var(--stroke); border-radius: 8px; padding: .1rem .45rem; white-space: nowrap; }
.reihen { margin-top: 1.2rem; display: grid; gap: .6rem; }
.reihen-titel { font-weight: 600; font-size: .92rem; }
.reihen-knoepfe { display: flex; gap: .4rem; flex-wrap: wrap; }

.themen { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: .8rem; margin-top: 1rem; }
.thema-karte {
    position: relative; display: flex; align-items: center; gap: .9rem; padding: 1rem 1.2rem; cursor: pointer;
    border-radius: 14px; border: 1px solid var(--stroke); background: rgba(0, 0, 0, .25); font-weight: 650; transition: all .2s;
}
.thema-icon { font-size: 2rem; }
.thema-karte:has(input:checked) {
    border-color: var(--magenta); background: linear-gradient(120deg, rgba(0, 90, 135, .35), rgba(255, 8, 232, .18));
    box-shadow: 0 0 0 1px rgba(255, 8, 232, .3), 0 10px 30px rgba(255, 8, 232, .15);
}
.form-reihe { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1rem; margin-top: 1.2rem; }
.form-reihe label { display: grid; gap: .35rem; font-size: .85rem; color: var(--muted); align-content: end; }
.absenden { display: flex; justify-content: center; margin: 1.6rem 0 1rem; }

/* Verwaltung */
.form-inline { display: flex; gap: .7rem; align-items: center; flex-wrap: wrap; margin-top: 1.2rem; }
.form-inline .field { max-width: 18rem; }
.check { display: flex; gap: .4rem; align-items: center; color: var(--muted); font-size: .9rem; }
.neu-pw .pw { font-size: 1.15rem; padding: .2rem .6rem; margin-left: .3rem; user-select: all; color: #fff; }

/* Blatt-Ansicht: Werkzeugleiste */
.werkzeug { display: grid; gap: 1rem; padding: 1.2rem 1.4rem; margin-bottom: 1.6rem; }
.werkzeug-titel { font-weight: 800; font-size: 1.3rem; letter-spacing: -.02em; }
.werkzeug-knoepfe { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.werkzeug-knoepfe form { display: inline-flex; gap: .4rem; }
.typen-liste { display: flex; gap: .35rem; flex-wrap: wrap; margin-top: .5rem; }
.tag { font-size: .75rem; padding: .15rem .55rem; border-radius: 8px; background: var(--glass-strong); border: 1px solid var(--stroke); color: var(--muted); }

@media (max-width: 760px) {
    .form-reihe { grid-template-columns: 1fr; }
    .gruppen { grid-template-columns: 1fr; }
    .blatt-tabelle th:nth-child(1), .blatt-tabelle td:nth-child(1),
    .blatt-tabelle th:nth-child(5), .blatt-tabelle td:nth-child(5) { display: none; }
}

[hidden] { display: none !important; }
a.btn { text-decoration: none; }
.zahlenraum { margin: 1rem 0 .2rem; }
.zr-marke {
    display: inline-block; font-size: .66rem; font-weight: 800; letter-spacing: .05em; padding: 0 .3rem;
    border-radius: 5px; background: var(--grad); color: #fff; vertical-align: 1px;
}
.einstellung { display: grid; gap: .55rem; margin-top: 1.1rem; }
.einstellung-titel { font-weight: 600; font-size: .92rem; }
.chip small { color: inherit; opacity: .75; font-size: .78rem; }
.typ.gibts-nicht .typ-text { opacity: .5; }
.typ.gibts-nicht small { font-style: italic; }
details.gross { margin-top: 1.2rem; border: 1px dashed var(--stroke); border-radius: 14px; padding: .7rem 1rem; }
details.gross summary { cursor: pointer; font-weight: 600; font-size: .95rem; }
details.gross[open] summary { margin-bottom: .2rem; }
.liste-werkzeug { display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap; font-size: .88rem; }
.spalte-wahl { width: 2rem; }
.spalte-wahl input, #alle-waehlen { width: 1.05rem; height: 1.05rem; accent-color: var(--magenta); cursor: pointer; }
.loeschen { display: inline-flex; gap: .4rem; align-items: center; }
.btn:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
td.aktionen { display: table-cell; text-align: right; white-space: nowrap; }
td.aktionen > * { margin-left: .3rem; vertical-align: middle; }
td.aktionen form { display: inline-flex; }
