/* kopfsprung_lab — pink/blau im Look von kopfsprung digital */

:root {
    --pink: #e8457a;
    --blue: #3b82f6;
    --gradient: linear-gradient(135deg, #3b82f6 0%, #e8457a 100%);
    --bg: #f8fafc;
    --card: #ffffff;
    --border: #e2e8f0;
    --text: #0f172a;
    --text-soft: #475569;
    --muted: #94a3b8;
    --danger: #e11d48;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    color: var(--text);
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
    line-height: 1.6;
    background:
        radial-gradient(55rem 28rem at 115% -5%, rgba(232, 69, 122, 0.10), transparent 60%),
        radial-gradient(50rem 28rem at -15% 105%, rgba(59, 130, 246, 0.10), transparent 60%),
        var(--bg);
    background-attachment: fixed;
}

/* ---------- Header ---------- */

header {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.7rem 1.5rem;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid #f1f5f9;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 0.65rem;
    font-weight: 900;
    font-size: 1.2rem;
    letter-spacing: -0.02em;
    text-decoration: none;
    color: var(--text);
}

.brand img {
    height: 2.4rem;
    width: auto;
    transition: transform 0.25s ease;
}
.brand:hover img { transform: rotate(-12deg); }

.brand .gradient, .gradient-text {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

nav { display: flex; gap: 1.2rem; align-items: center; }
nav a {
    color: var(--text-soft);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}
nav a:hover { color: var(--text); }
.cta {
    background: var(--gradient);
    color: #ffffff;
    padding: 0.55rem 1.1rem;
    border-radius: 0.85rem;
    box-shadow: 0 4px 14px rgba(232, 69, 122, 0.25);
    transition: filter 0.15s ease, transform 0.15s ease;
    white-space: nowrap;
}
.cta:hover { filter: brightness(1.08); transform: translateY(-1px); color: #fff; }
nav a.user { color: var(--muted); font-size: 0.9rem; font-weight: 600; }
nav a.user:hover { color: var(--pink); }

/* ---------- Layout ---------- */

main { width: 100%; max-width: 64rem; margin: 0 auto; padding: 2rem 1.5rem 4rem; flex: 1; }

h1 {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin: 1.8rem 0 0.4rem;
}

.subtitle { color: var(--text-soft); margin: 0 0 1.6rem; }

/* Titelzeile mit Aktion rechts (bricht auf Mobil sauber um) */
.page-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 0.6rem 1rem;
}
.page-head h1 { margin-top: 0; }
/* Auf dem Desktop reicht der CTA im Header – hier ausblenden, auf Mobil einblenden. */
.page-head .cta { display: none; }

/* ---------- Karten ---------- */

.card {
    background: var(--card);
    border: 1px solid #f1f5f9;
    border-radius: 1.75rem;
    padding: 1.75rem;
    box-shadow: 0 1px 3px rgba(15, 23, 42, 0.04);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.grid .card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px -8px rgba(232, 69, 122, 0.18);
    border-color: rgba(232, 69, 122, 0.25);
}

.card.narrow { max-width: 24rem; margin: 4rem auto; text-align: center; }
.card.narrow form { text-align: left; }
.card.narrow .logo-big { height: 7rem; margin-bottom: 0.8rem; }

.card h2 {
    font-size: 1.2rem;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin: 0 0 0.4rem;
}
.card h2 a { color: var(--text); text-decoration: none; }
.card h2 a:hover {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    gap: 1.25rem;
}

/* ---------- Badges & Meta ---------- */

.badge {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.7rem;
    border-radius: 9999px;
    margin-bottom: 0.6rem;
}
.badge.public     { background: #d1fae5; color: #047857; }
.badge.password   { background: #fef3c7; color: #b45309; }
.badge.registered { background: #dbeafe; color: #1d4ed8; }
.badge.private    { background: #fce7f0; color: #be185d; }

.meta, .muted { color: var(--muted); font-size: 0.85rem; margin: 0.2rem 0; }

.sources {
    background: #fffbeb;
    color: #b45309;
    font-size: 0.78rem;
    font-weight: 600;
    border-radius: 0.75rem;
    padding: 0.45rem 0.7rem;
    margin: 0.6rem 0 0;
    overflow-wrap: anywhere;
}

/* ---------- Aktionen ---------- */

.actions {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    align-items: center;
}

.btn {
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.45rem 0.85rem;
    font-size: 0.82rem;
    font-weight: 700;
    font-family: inherit;
    color: var(--text-soft);
    cursor: pointer;
    transition: border-color 0.15s ease, color 0.15s ease;
    white-space: nowrap;
}
.btn:hover { border-color: var(--pink); color: var(--pink); }

/* Drei-Punkte-Menü */
.menu { position: relative; margin-left: auto; }
.menu summary {
    list-style: none;
    cursor: pointer;
    background: #ffffff;
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 0.45rem 0.7rem;
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--text-soft);
    line-height: 1;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.menu summary::-webkit-details-marker { display: none; }
.menu summary:hover { border-color: var(--pink); color: var(--pink); }
.menu-items {
    position: absolute;
    right: 0;
    top: calc(100% + 0.4rem);
    z-index: 20;
    background: #ffffff;
    border: 1px solid #f1f5f9;
    border-radius: 1rem;
    box-shadow: 0 12px 40px -8px rgba(15, 23, 42, 0.18);
    padding: 0.4rem;
    min-width: 9rem;
}
.menu-items a, .menu-items .linklike {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.5rem 0.8rem;
    border-radius: 0.6rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-soft);
    text-decoration: none;
}
.menu-items a:hover { background: var(--bg); color: var(--text); }
.menu-items form { margin: 0; }

.linklike {
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
    padding: 0;
    color: var(--blue);
    font-size: 0.85rem;
    font-weight: 700;
}
.linklike.danger { color: var(--danger); }
.menu-items .linklike.danger:hover { background: #fff1f2; }

/* ---------- Formulare ---------- */

form label { display: block; margin: 1rem 0; font-weight: 600; font-size: 0.9rem; }
form .radio { margin: 0.4rem 0; font-weight: 500; cursor: pointer; }

input[type="text"], input[type="password"], textarea {
    width: 100%;
    margin-top: 0.35rem;
    padding: 0.65rem 0.9rem;
    background: var(--bg);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 0.85rem;
    font-size: 0.95rem;
    font-family: inherit;
}
input:focus, textarea:focus {
    outline: 2px solid var(--pink);
    outline-offset: -1px;
    border-color: transparent;
}

textarea {
    font-family: ui-monospace, 'Cascadia Code', Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.5;
}

fieldset {
    border: 1px solid var(--border);
    border-radius: 1rem;
    margin: 1rem 0;
    padding: 0.8rem 1.1rem;
}
legend {
    color: var(--text-soft);
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0 0.4rem;
}
input[type="radio"] { accent-color: var(--pink); }

/* Gradient nur für echte Formular-Buttons — nie für Menü-/Linkbuttons */
button[type="submit"]:not(.linklike) {
    background: var(--gradient);
    color: #ffffff;
    border: none;
    border-radius: 1rem;
    padding: 0.75rem 1.9rem;
    font-weight: 800;
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    margin-top: 0.8rem;
    box-shadow: 0 4px 16px rgba(232, 69, 122, 0.3);
    transition: filter 0.15s ease, transform 0.15s ease;
}
button[type="submit"]:not(.linklike):hover { filter: brightness(1.08); transform: translateY(-1px); }

.invite-note {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.07), rgba(232, 69, 122, 0.07));
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 1rem;
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    color: var(--text-soft);
    margin: 1rem 0;
}
.invite-note a { color: var(--pink); font-weight: 700; }

/* ---------- Flash & Empty State ---------- */

.flash {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08), rgba(232, 69, 122, 0.08));
    border: 1px solid rgba(232, 69, 122, 0.25);
    color: var(--text-soft);
    font-weight: 600;
    font-size: 0.9rem;
    border-radius: 1rem;
    padding: 0.7rem 1.1rem;
    margin-bottom: 1.2rem;
}

.empty {
    border: 2px dashed var(--border);
    border-radius: 1.75rem;
    padding: 3rem 1.5rem;
    text-align: center;
    color: var(--muted);
    font-weight: 600;
}
.empty a { color: var(--pink); }
.empty img { height: 6rem; opacity: 0.85; margin-bottom: 0.8rem; }

/* ---------- QR-Modal ---------- */

#qr-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.6);
    backdrop-filter: blur(4px);
    z-index: 100;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
#qr-overlay.open { display: flex; }
.qr-box { text-align: center; max-width: 20rem; }
.qr-box h2 { margin-bottom: 0.8rem; }
.qr-box img { width: 100%; max-width: 15rem; border-radius: 0.75rem; }

/* ---------- Admin / Nutzerverwaltung ---------- */

.back { margin: 1.4rem 0 0; }
.back a { color: var(--muted); text-decoration: none; font-weight: 700; font-size: 0.88rem; }
.back a:hover { color: var(--pink); }

h2.section { font-size: 1.3rem; font-weight: 900; letter-spacing: -0.02em; margin: 2rem 0 0.8rem; }

/* Aufklappbares „Neues Konto anlegen“ */
details.narrow-form { max-width: 30rem; margin: 0 0 1.5rem; padding: 1.25rem 1.5rem; }
details.narrow-form > summary {
    list-style: none;
    cursor: pointer;
    font-weight: 800;
    font-size: 1rem;
    color: var(--text);
}
details.narrow-form > summary::-webkit-details-marker { display: none; }
details.narrow-form[open] > summary { margin-bottom: 0.5rem; color: var(--pink); }

.card.narrow-form { max-width: 30rem; margin: 0 0 1.5rem; }
.card.narrow-form h2 { margin-top: 0; font-size: 1.15rem; }

.pw-row { display: flex; gap: 0.5rem; align-items: stretch; }
.pw-row input { flex: 1; }
.pw-row .btn { margin-top: 0.35rem; }

label.check {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-weight: 500;
    cursor: pointer;
}
label.check input { width: auto; margin: 0; accent-color: var(--pink); }

/* Nutzerliste — als stapelbare Reihen, mobil-first */
.user-list { display: flex; flex-direction: column; gap: 0.75rem; }
.user-row {
    display: block;
    position: relative;
    text-decoration: none;
    color: var(--text);
    padding: 1.1rem 2.5rem 1.1rem 1.4rem;
}
.user-row:hover {
    border-color: rgba(232, 69, 122, 0.25);
    box-shadow: 0 8px 28px -10px rgba(232, 69, 122, 0.2);
}
.user-main { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.user-name { font-weight: 800; font-size: 1.05rem; }
.user-row .badge { margin-bottom: 0; }
.user-row .meta { margin: 0.3rem 0 0; }
.chevron {
    position: absolute;
    right: 1.2rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--muted);
    font-size: 1.6rem;
    font-weight: 400;
}

.danger-zone { border-color: rgba(225, 29, 72, 0.3); margin-top: 1.5rem; max-width: 30rem; }
.danger-zone h2 { margin-top: 0; color: var(--danger); font-size: 1.15rem; }

/* ---------- Mobil ---------- */

@media (max-width: 560px) {
    header { padding: 0.6rem 1rem; flex-wrap: wrap; gap: 0.4rem 0.8rem; }
    /* Nav auf eigene Zeile unter das Logo, rechtsbündig – nichts läuft mehr aus dem Bild. */
    nav { flex: 1 1 100%; justify-content: flex-end; gap: 0.8rem 1rem; flex-wrap: wrap; }
    .cta { padding: 0.45rem 0.9rem; }
    /* Header-CTA auf Mobil ausblenden – das Dashboard hat einen eigenen,
       immer sichtbaren „Neues Programm“-Button in der Titelzeile. */
    header .cta { display: none; }
    .page-head .cta { display: block; width: 100%; text-align: center; }
    main { padding: 1.5rem 1rem 3rem; }
    h1 { font-size: 1.6rem; }
    .grid { grid-template-columns: 1fr; }
}

/* ---------- Footer ---------- */

footer {
    border-top: 1px solid #f1f5f9;
    padding: 1.5rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
}
footer a { color: var(--muted); text-decoration: none; margin: 0 0.5rem; }
footer a:hover { color: var(--pink); }
