/*
 * Ticketbörse – Stylesheet
 *
 * Bewusst ohne Framework und ohne JavaScript: Die Börse muss auch auf alten
 * Geräten und mit Screenreader zuverlässig funktionieren.
 */

:root {
    --farbe-text: #1c1c21;
    --farbe-text-leise: #5d6068;
    --farbe-hintergrund: #f6f6f8;
    --farbe-flaeche: #ffffff;
    --farbe-rand: #dcdce3;
    --farbe-akzent: #7a1f3d;
    --farbe-akzent-hell: #f3e7ec;
    --farbe-erfolg: #1f6b3a;
    --farbe-erfolg-hell: #e6f3ea;
    --farbe-fehler: #a32020;
    --farbe-fehler-hell: #fbeaea;
    --farbe-hinweis-hell: #fdf5e3;
    --radius: 10px;
    --schatten: 0 1px 2px rgba(16, 16, 24, .06), 0 4px 12px rgba(16, 16, 24, .05);
}

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

body {
    margin: 0;
    font-family: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    font-size: 17px;
    line-height: 1.6;
    color: var(--farbe-text);
    background: var(--farbe-hintergrund);
}

.wrap {
    width: 100%;
    max-width: 62rem;
    margin: 0 auto;
    padding: 0 1rem;
}

.skip-link {
    position: absolute;
    left: -9999px;
}

.skip-link:focus {
    position: static;
    display: inline-block;
    margin: .5rem;
    padding: .5rem;
    background: var(--farbe-flaeche);
}

/* --- Kopf und Fuß --- */

.site-header {
    background: var(--farbe-flaeche);
    border-bottom: 1px solid var(--farbe-rand);
}

.header-inner {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem 1.5rem;
    align-items: baseline;
    justify-content: space-between;
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.brand-club {
    font-size: .8rem;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: var(--farbe-text-leise);
}

.brand-app {
    font-size: 1.35rem;
    font-weight: 700;
    color: var(--farbe-akzent);
}

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

.site-nav a {
    color: var(--farbe-text);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    padding-bottom: 2px;
}

.site-nav a:hover,
.site-nav a:focus {
    border-bottom-color: var(--farbe-akzent);
}

main {
    padding-top: 2rem !important;
    padding-bottom: 3rem !important;
}

.site-footer {
    border-top: 1px solid var(--farbe-rand);
    background: var(--farbe-flaeche);
    padding: 1.5rem 0 2.5rem;
    font-size: .9rem;
}

.site-footer p {
    margin: .35rem 0;
}

/* --- Typografie --- */

h1 {
    font-size: 1.9rem;
    line-height: 1.25;
    margin: 0 0 .5rem;
}

h2 {
    font-size: 1.3rem;
    margin: 2rem 0 .75rem;
}

h3 {
    font-size: 1.05rem;
    margin: 1.5rem 0 .5rem;
}

a {
    color: var(--farbe-akzent);
}

.lead {
    font-size: 1.08rem;
    color: var(--farbe-text-leise);
    margin-top: 0;
}

.muted {
    color: var(--farbe-text-leise);
    font-size: .92rem;
}

.text-block {
    max-width: 44rem;
}

.text-block li + li {
    margin-top: .35rem;
}

/* --- Karten und Flächen --- */

.card {
    background: var(--farbe-flaeche);
    border: 1px solid var(--farbe-rand);
    border-radius: var(--radius);
    box-shadow: var(--schatten);
    padding: 1.25rem 1.5rem;
    margin-bottom: 1.25rem;
}

.card h2:first-child,
.card h3:first-child {
    margin-top: 0;
}

.note {
    border-left: 4px solid var(--farbe-akzent);
    background: var(--farbe-akzent-hell);
    border-radius: 0 var(--radius) var(--radius) 0;
    padding: .9rem 1.1rem;
    margin: 1.25rem 0;
}

.note-info {
    border-left-color: #b98a1d;
    background: var(--farbe-hinweis-hell);
}

.flash {
    border-radius: var(--radius);
    padding: .85rem 1.1rem;
    margin-bottom: 1.25rem;
    border: 1px solid transparent;
}

.flash-success {
    background: var(--farbe-erfolg-hell);
    border-color: #bcdcc7;
    color: var(--farbe-erfolg);
}

.flash-error {
    background: var(--farbe-fehler-hell);
    border-color: #efc2c2;
    color: var(--farbe-fehler);
}

/* --- Inserate --- */

.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    margin: 1.5rem 0;
}

.filter-bar a {
    display: inline-block;
    padding: .35rem .85rem;
    border: 1px solid var(--farbe-rand);
    border-radius: 999px;
    background: var(--farbe-flaeche);
    text-decoration: none;
    color: var(--farbe-text);
    font-size: .92rem;
}

.filter-bar a.is-active {
    background: var(--farbe-akzent);
    border-color: var(--farbe-akzent);
    color: #fff;
}

.listing-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr));
    padding: 0;
    margin: 0;
    list-style: none;
}

.listing-card {
    display: flex;
    flex-direction: column;
    gap: .5rem;
    background: var(--farbe-flaeche);
    border: 1px solid var(--farbe-rand);
    border-radius: var(--radius);
    box-shadow: var(--schatten);
    padding: 1.1rem 1.2rem;
}

.listing-card h3 {
    margin: 0;
    font-size: 1.05rem;
}

.listing-event {
    font-size: .85rem;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--farbe-text-leise);
}

.listing-price {
    font-size: 1.25rem;
    font-weight: 700;
}

.listing-meta {
    margin: 0;
    font-size: .92rem;
    color: var(--farbe-text-leise);
}

.listing-card .button {
    margin-top: auto;
}

.badge {
    display: inline-block;
    padding: .1rem .55rem;
    border-radius: 999px;
    font-size: .78rem;
    font-weight: 600;
    letter-spacing: .02em;
    background: #ececed;
    color: var(--farbe-text-leise);
}

.badge-active {
    background: var(--farbe-erfolg-hell);
    color: var(--farbe-erfolg);
}

.badge-reserved {
    background: var(--farbe-hinweis-hell);
    color: #8a6410;
}

.badge-blocked,
.badge-withdrawn {
    background: var(--farbe-fehler-hell);
    color: var(--farbe-fehler);
}

.badge-pending {
    background: #ececf5;
    color: #45497a;
}

.definition-list {
    display: grid;
    grid-template-columns: max-content 1fr;
    gap: .35rem 1.25rem;
    margin: 1rem 0;
}

.definition-list dt {
    color: var(--farbe-text-leise);
}

.definition-list dd {
    margin: 0;
    font-weight: 600;
}

/* --- Formulare --- */

form {
    margin: 0;
}

/*
 * Der Abstand zwischen zwei Feldern muss deutlich größer sein als der zwischen
 * einem Feld und seinem darunter stehenden Hinweis - sonst liest sich der
 * Hinweis als Vorbemerkung zum folgenden Feld.
 */
.field {
    margin-bottom: 1.5rem;
}

.field > label,
fieldset > legend {
    display: block;
    font-weight: 600;
    margin-bottom: .3rem;
}

/*
 * Der erläuternde Hinweis steht unter dem Eingabefeld: Die Beschriftung sagt,
 * was gefragt ist, der Hinweis ergänzt beim Ausfüllen. Der Abstand geht deshalb
 * nach oben (zum eigenen Feld) statt nach unten - sonst rutschte er optisch
 * zum nächsten Feld.
 */
.field-hint {
    display: block;
    font-weight: 400;
    font-size: .88rem;
    color: var(--farbe-text-leise);
    margin-top: .25rem;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="password"],
input[type="datetime-local"],
select,
textarea {
    width: 100%;
    padding: .55rem .7rem;
    font: inherit;
    color: inherit;
    background: var(--farbe-flaeche);
    border: 1px solid #b9bac4;
    border-radius: 8px;
}

input:focus,
select:focus,
textarea:focus {
    outline: 3px solid var(--farbe-akzent-hell);
    border-color: var(--farbe-akzent);
}

textarea {
    min-height: 8rem;
    resize: vertical;
}

.field-row {
    display: flex;
    flex-wrap: wrap;
    /* Zeilenabstand wie zwischen einzelnen Feldern, damit die Reihe beim
       Umbruch auf schmalen Bildschirmen denselben Rhythmus behält. */
    gap: 1.5rem 1rem;
    margin-bottom: 1.5rem;
}

.field-row > .field {
    flex: 1 1 12rem;
    margin-bottom: 0;
}

.checkbox {
    display: flex;
    gap: .6rem;
    align-items: flex-start;
}

.checkbox input {
    margin-top: .35rem;
    flex: 0 0 auto;
}

/*
 * Ankreuzfelder: Beschriftung neben dem Kästchen statt darüber, deshalb ohne
 * den Abstand nach unten.
 */
.checkbox label {
    font-weight: 400;
    margin-bottom: 0;
}

.field-error {
    margin: .3rem 0 0;
    color: var(--farbe-fehler);
    font-size: .9rem;
    font-weight: 600;
}

fieldset {
    border: 1px solid var(--farbe-rand);
    border-radius: var(--radius);
    padding: 1rem 1.2rem;
    margin: 0 0 1.25rem;
}

/* Honeypot: für Menschen unsichtbar, für Bots verlockend. */
.hp {
    position: absolute;
    left: -9999px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.button,
button {
    display: inline-block;
    padding: .6rem 1.2rem;
    font: inherit;
    font-weight: 600;
    color: #fff;
    background: var(--farbe-akzent);
    border: 1px solid var(--farbe-akzent);
    border-radius: 8px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
}

.button:hover,
button:hover {
    background: #641930;
}

.button-secondary {
    background: var(--farbe-flaeche);
    color: var(--farbe-text);
    border-color: #b9bac4;
}

.button-secondary:hover {
    background: #eeeef2;
}

.button-danger {
    background: var(--farbe-fehler);
    border-color: var(--farbe-fehler);
}

.button-danger:hover {
    background: #841919;
}

.button-row {
    display: flex;
    flex-wrap: wrap;
    gap: .6rem;
    align-items: center;
    margin-top: 1rem;
}

/* --- Nachrichten --- */

.thread {
    display: flex;
    flex-direction: column;
    gap: .9rem;
    margin: 1.5rem 0;
}

.message {
    border: 1px solid var(--farbe-rand);
    border-radius: var(--radius);
    background: var(--farbe-flaeche);
    padding: .9rem 1.1rem;
    max-width: 42rem;
}

.message-own {
    background: var(--farbe-akzent-hell);
    border-color: #e3ccd5;
    align-self: flex-end;
}

.message-header {
    font-size: .85rem;
    color: var(--farbe-text-leise);
    margin-bottom: .35rem;
}

.message p {
    margin: 0 0 .5rem;
}

.message p:last-child {
    margin-bottom: 0;
}

.message-undelivered {
    border-style: dashed;
}

/* --- Tabellen (Adminbereich) --- */

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: .93rem;
}

th, td {
    text-align: left;
    padding: .55rem .7rem;
    border-bottom: 1px solid var(--farbe-rand);
    vertical-align: top;
}

th {
    font-size: .8rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--farbe-text-leise);
}

tbody tr:hover {
    background: #fafafc;
}

.kpi-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
    margin-bottom: 1.5rem;
}

.kpi {
    background: var(--farbe-flaeche);
    border: 1px solid var(--farbe-rand);
    border-radius: var(--radius);
    padding: .9rem 1.1rem;
}

.kpi-value {
    display: block;
    font-size: 1.7rem;
    font-weight: 700;
    line-height: 1.2;
}

.kpi-label {
    font-size: .85rem;
    color: var(--farbe-text-leise);
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 1.25rem;
    padding: .75rem 0;
    border-bottom: 1px solid var(--farbe-rand);
    background: var(--farbe-flaeche);
}

.inline-form {
    display: inline;
}

.empty-state {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--farbe-text-leise);
}

.break-all {
    word-break: break-all;
}

@media (max-width: 40rem) {
    body {
        font-size: 16px;
    }

    .definition-list {
        grid-template-columns: 1fr;
        gap: 0 0;
    }

    .definition-list dd {
        margin-bottom: .6rem;
    }
}
