@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800;900&display=swap');

:root {
    --ink: #000000;
    --charcoal: #3C3C3B;
    --steel: #575756;
    --mist: #D9DADA;
    --paper: #FFFFFF;
    --accent: #E2231A;
    --accent-dark: #A31812;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Archivo', sans-serif;
    color: var(--ink);
    background: var(--paper);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    font-feature-settings: "ss01";
}

a { color: inherit; }

.wrap {
    max-width: 760px;
    margin: 0 auto;
    padding: 0 28px;
}

/* --- Logo-Leiste ------------------------------------------------- */

.logo-bar {
    background: var(--ink);
    padding: 22px 0;
}

.logo-bar img { height: 24px; display: block; }

/* --- Hero / Event-Kopf --------------------------------------------- */

.event-head {
    background: var(--charcoal);
    color: var(--paper);
    padding: 64px 0 0;
    border-top: 5px solid var(--accent);
}

.event-head h1 {
    font-size: clamp(30px, 4.6vw, 48px);
    font-weight: 900;
    line-height: 1.08;
    letter-spacing: -0.01em;
    margin: 0 0 40px;
    max-width: 16ch;
}

.spec-row {
    display: flex;
    border-top: 1px solid rgba(255,255,255,0.25);
    margin-top: 0;
}

.spec-item {
    flex: 1;
    padding: 18px 24px 32px 0;
    border-right: 1px solid rgba(255,255,255,0.25);
}

.spec-item:last-child { border-right: none; padding-right: 0; }
.spec-item:first-child { padding-left: 0; }
.spec-item + .spec-item { padding-left: 24px; }

.spec-item .label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.55);
    margin-bottom: 7px;
}

.spec-item .value {
    display: block;
    font-size: 16px;
    font-weight: 600;
}

/* --- Inhalt -------------------------------------------------------- */

.event-body { padding: 48px 0 8px; }

.event-description {
    font-size: 17px;
    color: var(--steel);
    max-width: 58ch;
    margin: 0 0 44px;
    white-space: pre-line;
}

.section-label {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 24px;
}

.status-banner {
    border-top: 1px solid var(--mist);
    border-bottom: 1px solid var(--mist);
    padding: 20px 0;
    font-size: 15px;
    color: var(--steel);
    margin-bottom: 32px;
}

/* --- Formular -------------------------------------------------------- */

form { margin-bottom: 64px; }

.field { margin-bottom: 26px; }

.field label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--steel);
    margin-bottom: 9px;
}

.field .required { color: var(--ink); }

.field input,
.field textarea {
    width: 100%;
    padding: 8px 0 9px;
    border: none;
    border-bottom: 2px solid var(--mist);
    border-radius: 0;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
    color: var(--ink);
    transition: border-color 0.15s ease;
}

.field input:focus,
.field textarea:focus {
    outline: none;
    border-bottom-color: var(--accent);
}

.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

@media (max-width: 560px) {
    .field-row { grid-template-columns: 1fr; gap: 0; }
    .spec-row { flex-direction: column; }
    .spec-item { border-right: none; border-bottom: 1px solid rgba(255,255,255,0.25); padding: 16px 0 !important; }
    .spec-item:last-child { border-bottom: none; }
}

.field textarea { min-height: 90px; resize: vertical; }

.consent {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    font-size: 14px;
    color: var(--steel);
    margin: 36px 0 32px;
}

.consent input {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--accent);
}

.consent a { color: var(--ink); text-decoration: underline; }

.btn {
    display: inline-block;
    background: var(--accent);
    color: var(--paper);
    border: none;
    padding: 15px 30px;
    font-family: inherit;
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    border-radius: 3px;
    transition: background 0.15s ease, transform 0.12s ease, box-shadow 0.15s ease;
    box-shadow: 0 2px 0 rgba(0,0,0,0.15);
}

.btn:hover { background: var(--accent-dark); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(226,35,26,0.35); }
.btn:active { transform: translateY(0); box-shadow: 0 1px 0 rgba(0,0,0,0.15); }
.btn:disabled { background: var(--mist); color: var(--steel); cursor: not-allowed; box-shadow: none; transform: none; }

.btn-secondary {
    background: var(--paper);
    color: var(--ink);
    border: 1.5px solid var(--ink);
    box-shadow: none;
}

.btn-secondary:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: translateY(-1px); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }

.error-text { color: #A3231F; font-size: 13px; margin-top: 6px; }

.form-error, .form-success {
    padding: 16px 0;
    border-top: 1px solid var(--ink);
    border-bottom: 1px solid var(--ink);
    font-size: 15px;
    margin-bottom: 32px;
}

.form-success { color: var(--ink); }
.form-error { color: #A3231F; border-color: #A3231F; }

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

footer {
    background: var(--ink);
    color: var(--mist);
    font-size: 13px;
    padding: 24px 0;
}

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

.admin-shell { background: var(--paper); min-height: 100vh; }

.admin-topbar {
    background: var(--ink);
    padding: 20px 0;
    border-bottom: 4px solid var(--accent);
}

.admin-topbar .wrap {
    max-width: 980px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-topbar img { height: 22px; display: block; }

.admin-topbar a.logout {
    font-size: 14px;
    color: var(--mist);
    text-decoration: none;
}

.admin-main { max-width: 980px; margin: 0 auto; padding: 48px 28px; }

.admin-main h1 {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 32px;
}

.table-card {
    background: var(--paper);
    border: 1px solid var(--mist);
    border-radius: 4px;
    overflow: visible;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.event-table {
    width: 100%;
    border-collapse: collapse;
}

.event-table th,
.event-table td {
    text-align: left;
    padding: 18px 20px;
    border-bottom: 1px solid var(--mist);
    font-size: 14px;
}

.event-table th:first-child, .event-table td:first-child { padding-left: 24px; }
.event-table th:last-child, .event-table td:last-child { padding-right: 24px; }

.event-table th {
    font-weight: 700;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--steel);
    border-bottom: 1px solid var(--ink);
}

.pill {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
}

.pill-active { color: #146C2E; background: #E3F5E8; }
.pill-inactive { color: var(--steel); background: var(--mist); }

.link-copy { font-size: 13px; color: var(--steel); display: flex; align-items: center; gap: 8px; }
.link-copy a { text-decoration: none; }
.link-copy a:hover code { background: var(--charcoal); color: var(--paper); }
.link-copy code {
    color: var(--ink);
    font-family: 'Archivo', sans-serif;
    background: var(--mist);
    padding: 4px 10px;
    border-radius: 3px;
    font-size: 12px;
    transition: background 0.12s ease, color 0.12s ease;
}

.copy-btn {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    padding: 4px;
    flex-shrink: 0;
}
.copy-btn:hover { text-decoration: underline; }

.actions-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.admin-card { max-width: 560px; background: var(--paper); border: 1px solid var(--mist); padding: 32px; border-radius: 4px; }

.login-shell {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--charcoal);
}

.login-shell .logo-bar {
    background: transparent;
    text-align: left;
    padding: 0 0 40px;
}

.login-shell .admin-card {
    width: 100%;
    max-width: 380px;
    background: var(--paper);
    padding: 36px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    border: none;
}

.login-shell h1 {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 28px;
}

/* --- Sanfter Eintritts-Effekt ------------------------------------------- */

@keyframes fadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.event-body, .admin-main, .confirmation-inner {
    animation: fadeUp 0.5s ease both;
}

.event-head h1 { animation: fadeUp 0.6s ease both; }
.spec-row { animation: fadeUp 0.6s ease 0.1s both; }

/* --- Barrierefreiheit ------------------------------------------------- */

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -100%;
    left: 12px;
    background: var(--ink);
    color: var(--paper);
    padding: 12px 18px;
    z-index: 100;
    text-decoration: none;
    font-size: 14px;
    border-radius: 0 0 2px 2px;
    transition: top 0.15s ease;
}

.skip-link:focus { top: 0; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
.btn:focus-visible {
    outline: 2px solid var(--ink);
    outline-offset: 3px;
}

.event-head a:focus-visible,
.admin-topbar a:focus-visible,
.login-shell a:focus-visible,
.btn:focus-visible {
    outline-color: var(--paper);
}

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

/* --- Logo-Link (klickbar) -------------------------------------------- */

.logo-link {
    display: inline-flex;
    border-radius: 2px;
    transition: opacity 0.15s ease;
}

.logo-link:hover { opacity: 0.8; }

/* --- Feinschliff: Eckmarkierung + Übergänge --------------------------- */

.event-head {
    position: relative;
}

.event-head::before {
    content: "";
    position: absolute;
    top: 0; left: 0;
    width: 40px; height: 40px;
    border-top: 2px solid rgba(255,255,255,0.5);
    border-left: 2px solid rgba(255,255,255,0.5);
}

.spec-item .value { transition: color 0.15s ease; }

.event-table tbody tr { transition: background 0.12s ease; }
.event-table tbody tr:hover { background: #FAFAFA; }

.pill { transition: background 0.12s ease; }

/* --- Tap-Targets / Mobile ---------------------------------------------- */

.btn, .btn-secondary { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; }
.btn-block { width: 100%; }
.btn-row { display: flex; gap: 12px; margin-top: 8px; }

.consent input, .logout, a.logout { min-height: 24px; }

.login-box { width: 100%; max-width: 380px; }

.admin-card--wide { max-width: 640px; }

.select-field {
    width: 100%;
    padding: 10px 0;
    border: none;
    border-bottom: 1px solid var(--mist);
    border-radius: 0;
    background: transparent;
    font-family: inherit;
    font-size: 16px;
}

/* --- Responsive Tabelle (Karten-Layout ab 720px) ----------------------- */

@media (max-width: 720px) {
    .event-table thead { display: none; }

    .event-table, .event-table tbody, .event-table tr, .event-table td {
        display: block;
        width: 100%;
    }

    .event-table tr {
        border-bottom: 1px solid var(--mist);
        padding: 16px 20px;
    }

    .event-table tr:first-child { border-top: none; }

    .event-table td {
        border-bottom: none;
        padding: 6px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
    }

    .event-table td:first-child, .event-table td:last-child { padding-left: 0; padding-right: 0; }

    .event-table td::before {
        content: attr(data-label);
        font-size: 12px;
        color: var(--steel);
        flex-shrink: 0;
    }

    .event-table td[data-label="Anmeldelink"] { align-items: flex-start; }
    .link-copy { text-align: right; word-break: break-all; }

    .actions-bar { flex-direction: column; align-items: flex-start; gap: 16px; }
    .actions-bar .btn { width: 100%; }

    .btn-row { flex-direction: column; }
    .btn-row .btn, .btn-row .btn-secondary { width: 100%; }
}

@media (max-width: 480px) {
    .admin-main, .wrap { padding-left: 20px; padding-right: 20px; }
    .event-head h1 { font-size: 26px; }
}

/* --- Banner-Bild im Hero ---------------------------------------------- */

.event-banner {
    height: 260px;
    background-size: cover;
    background-position: center;
    border-bottom: 1px solid rgba(255,255,255,0.25);
    position: relative;
}

.event-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0,0,0,0.05) 0%, rgba(0,0,0,0.55) 100%);
}

@media (max-width: 560px) {
    .event-banner { height: 180px; }
}

/* --- Referent/Speaker-Block ------------------------------------------- */

.speaker-block {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--mist);
}

.speaker-photo {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.speaker-block .label {
    display: block;
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--steel);
    margin-bottom: 4px;
}

.speaker-name {
    display: block;
    font-size: 16px;
    font-weight: 600;
}

/* --- Bestätigungsbildschirm --------------------------------------------- */

.confirmation-screen {
    min-height: calc(100vh - 68px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 0;
}

.confirmation-inner {
    text-align: center;
    max-width: 480px;
}

.confirmation-video {
    width: 260px;
    max-width: 70vw;
    background: #fff;
    margin: 0 auto 24px;
    display: block;
}

.confirmation-inner h1 {
    font-size: 26px;
    font-weight: 800;
    margin: 0 0 16px;
}

.confirmation-inner p {
    color: var(--steel);
    font-size: 16px;
}

/* --- Footer mit Rechtlichem --------------------------------------------- */

.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
}

.footer-links { display: flex; gap: 20px; }
.footer-links a { color: var(--mist); text-decoration: none; font-size: 13px; }
.footer-links a:hover { color: var(--paper); text-decoration: underline; }

/* --- Kebab-Menü (⋮ Mehr Optionen) --------------------------------------- */

.menu-wrap { position: relative; display: inline-block; }

.btn-icon {
    background: transparent;
    border: 1px solid var(--mist);
    width: 40px;
    height: 40px;
    border-radius: 2px;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    color: var(--ink);
}

.btn-icon:hover { background: var(--near-white, #F7F7F7); border-color: var(--ink); }

.dropdown-menu {
    position: absolute;
    right: 0;
    top: calc(100% + 4px);
    background: var(--paper);
    border: 1px solid var(--ink);
    min-width: 220px;
    z-index: 20;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
}

.dropdown-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 12px 16px;
    font-family: inherit;
    font-size: 14px;
    cursor: pointer;
    color: var(--ink);
}

.dropdown-item:hover { background: var(--mist); }
.dropdown-item--danger { color: #A3231F; }
.dropdown-item--danger:hover { background: #FCEBEB; }

.row-actions { display: flex; align-items: center; gap: 8px; justify-content: flex-end; }

@media (max-width: 720px) {
    .row-actions { justify-content: flex-start; width: 100%; }
    .dropdown-menu { right: auto; left: 0; }
}

.delete-form { display: none; }

/* --- Formular-Zusatzstile (Uploads, Hinweistexte) ----------------------- */

.field-hint {
    font-size: 12px;
    color: var(--steel);
    margin: 6px 0 0;
}

.field input[type="file"] {
    border: 1px dashed var(--mist);
    padding: 12px;
    font-size: 14px;
}

.current-upload {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--steel);
    margin-top: 8px;
}

.current-upload img {
    width: 36px;
    height: 36px;
    object-fit: cover;
    border-radius: 4px;
}

/* --- Hero mit Banner-Bild als Hintergrund (abgedunkelt) ------------------ */

.event-head.has-banner {
    background-size: cover;
    background-position: center;
    padding-top: 120px;
    position: relative;
    isolation: isolate;
}

.event-head.has-banner::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background:
        linear-gradient(180deg, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.78) 100%);
}

.event-head.has-banner .wrap { position: relative; }

.event-head.has-banner h1 { text-shadow: 0 2px 24px rgba(0,0,0,0.45); }

@media (max-width: 560px) {
    .event-head.has-banner { padding-top: 72px; }
}

/* --- Wartelisten-Bildschirm (Warnstil) ---------------------------------- */

.waitlist-icon {
    width: 120px;
    height: 120px;
    margin: 0 auto 28px;
    animation: popIn 0.5s cubic-bezier(0.2, 1.4, 0.4, 1) both, warnPulse 2.6s ease-in-out 0.8s infinite;
}

.waitlist-icon svg { display: block; overflow: visible; }

.warn-bar { animation: warnDrop 0.5s ease 0.35s both; transform-origin: 60px 42px; }
.warn-dot { animation: popIn 0.35s ease 0.7s both; transform-origin: 60px 91px; }

@keyframes popIn {
    from { opacity: 0; transform: scale(0.4); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes warnPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.06); }
}

@keyframes warnDrop {
    from { opacity: 0; transform: translateY(-8px) scaleY(0.6); }
    to { opacity: 1; transform: translateY(0) scaleY(1); }
}

.waitlist-note {
    margin-top: 28px;
    text-align: left;
    background: #FFF6DC;
    border-left: 4px solid #F2A900;
    padding: 16px 20px;
    font-size: 15px;
    color: #5C4300;
    border-radius: 0 3px 3px 0;
}


/* --- Anmeldezahlen im Dashboard ------------------------------------------ */

.count-main { font-size: 17px; font-weight: 800; }
.count-max { color: var(--steel); font-weight: 600; }
.count-none { color: var(--steel); }
.count-wait { display: block; margin-top: 4px; font-size: 12px; font-weight: 600; color: #8A5A00; }
.pill-full { background: #FFF0D1; color: #8A5A00; margin-left: 8px; }
.event-table tbody tr:last-child { border-bottom: none; }


/* --- Breites Dashboard ---------------------------------------------------- */

.admin-main--wide { max-width: 1440px; }
.admin-topbar .wrap.wrap--wide { max-width: 1440px; }

.admin-main--wide .event-table th,
.admin-main--wide .event-table td { padding: 18px 16px; }
.admin-main--wide .event-table th:first-child,
.admin-main--wide .event-table td:first-child { padding-left: 24px; }
.admin-main--wide .event-table th:last-child,
.admin-main--wide .event-table td:last-child { padding-right: 24px; }

.admin-main--wide .row-actions { white-space: nowrap; }
.admin-main--wide .link-copy code { word-break: break-all; }

/* Kartenansicht der Tabelle schon unter 1100px, damit nichts über den Rahmen ragt */
@media (max-width: 1100px) {
    .admin-main--wide .event-table thead { display: none; }

    .admin-main--wide .event-table,
    .admin-main--wide .event-table tbody,
    .admin-main--wide .event-table tr,
    .admin-main--wide .event-table td { display: block; width: 100%; }

    .admin-main--wide .event-table tr {
        border-bottom: 1px solid var(--mist);
        padding: 16px 20px;
    }

    .admin-main--wide .event-table td {
        border-bottom: none;
        padding: 6px 0;
        display: flex;
        justify-content: space-between;
        align-items: center;
        gap: 16px;
    }

    .admin-main--wide .event-table td:first-child,
    .admin-main--wide .event-table td:last-child { padding-left: 0; padding-right: 0; }

    .admin-main--wide .event-table td::before {
        content: attr(data-label);
        font-size: 12px;
        color: var(--steel);
        flex-shrink: 0;
    }

    .admin-main--wide .event-table td[data-label="Anmeldelink"],
    .admin-main--wide .event-table td[data-label="Anmeldungen"] { align-items: flex-start; }
    .admin-main--wide .count-cell { text-align: right; }
    .admin-main--wide .link-copy { text-align: right; }
    .admin-main--wide .row-actions { justify-content: flex-start; width: auto; }
}


/* --- Button "Teilnehmerliste" in der Admin-Kopfzeile ------------------------ */

.topbar-actions { display: flex; align-items: center; gap: 24px; }

.topbar-btn {
    border: 1.5px solid rgba(255,255,255,0.7);
    color: var(--paper);
    padding: 9px 16px;
    border-radius: 3px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.topbar-btn:hover { background: var(--paper); color: var(--ink); border-color: var(--paper); }

@media (max-width: 560px) {
    .topbar-actions { gap: 14px; }
    .topbar-btn { padding: 8px 12px; font-size: 13px; }
}


/* --- Link-Box, Warn-Dialog (Änderungen verwerfen) ------------------------- */

.link-box {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    background: #F7F7F7;
    border: 1px solid var(--mist);
    border-radius: 3px;
    margin-bottom: 28px;
}

.link-box__label {
    font-size: 11px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--steel);
    font-weight: 700;
}

.confirm-dialog {
    border: none;
    border-radius: 4px;
    padding: 32px;
    width: min(460px, calc(100% - 40px));
    box-shadow: 0 24px 70px rgba(0,0,0,0.35);
    font-family: inherit;
    color: var(--ink);
}

.confirm-dialog::backdrop { background: rgba(0,0,0,0.6); }
.confirm-dialog h2 { margin: 16px 0 12px; font-size: 20px; }
.confirm-dialog p { margin: 0 0 24px; color: var(--steel); }
.confirm-dialog .btn-row { margin-top: 0; }

.btn-danger { background: #A3231F; box-shadow: none; }
.btn-danger:hover { background: #7f1a17; box-shadow: 0 4px 10px rgba(163,35,31,0.35); }


/* --- Spamschutz: verstecktes Feld (Honeypot) ------------------------------ */

.hp-field {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
