/* AboCourt – Erscheinungsbild (Runbook Abschnitt 12): Indigo #1F2A5C, Gelbgrün #C6E03B, heller Grund #F4F6EE, Schrift Outfit. */

/* Outfit (SIL OFL 1.1, siehe fonts/OFL.txt) selbst gehostet: kein Abruf bei Google (DSGVO).
   Variable Schrift, eine Datei für alle Stärken. Wird später eine WOFF2-Datei ergänzt, hier vor der TTF eintragen. */
@font-face {
    font-family: "Outfit";
    src: url("fonts/Outfit-VariableFont_wght.ttf") format("truetype");
    font-weight: 100 900;
    font-style: normal;
    font-display: swap;
}

:root {
    --indigo: #1F2A5C;
    --indigo-600: #2c3a7a;
    --indigo-100: #e3e6f2;
    --lime: #C6E03B;
    --lime-200: #ecf5c4;
    --ground: #F4F6EE;
    --surface: #ffffff;
    --text: #1F2A5C;
    --muted: #5d6585;
    --line: #dde1e8;
    --danger: #b3261e;
    --danger-100: #fbe9e7;
    --ok: #3f7d20;
    --radius: 12px;
    --shadow: 0 1px 2px rgba(31, 42, 92, .06), 0 2px 8px rgba(31, 42, 92, .06);
    --font: "Outfit", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html, body {
    margin: 0;
    background: var(--ground);
    color: var(--text);
    font-family: var(--font);
    font-size: 16px;
    line-height: 1.5;
}

h1, h2, h3 { font-weight: 600; letter-spacing: -.01em; line-height: 1.2; margin: 0 0 .75rem; }
h1 { font-size: 1.6rem; }
h2 { font-size: 1.2rem; margin-top: 1.5rem; }
h1:focus { outline: none; }
a { color: var(--indigo-600); }
p { margin: 0 0 1rem; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }

/* ---------- Grundlayout ---------- */

.shell { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    padding: .75rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.topbar .brand img { height: 32px; display: block; }

.topbar nav { display: flex; gap: .25rem; flex: 1; flex-wrap: wrap; }

.topbar nav a {
    text-decoration: none;
    color: var(--muted);
    padding: .4rem .75rem;
    border-radius: 999px;
    font-weight: 500;
}

.topbar nav a:hover { background: var(--indigo-100); color: var(--indigo); }
.topbar nav a.active { background: var(--indigo); color: #fff; }

.topbar .user { display: flex; align-items: center; gap: .75rem; color: var(--muted); }

main.content { flex: 1; width: 100%; max-width: 960px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem; }

/* ---------- Bausteine ---------- */

.card {
    background: var(--surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.stack > * + * { margin-top: .75rem; }
.row { display: flex; gap: .75rem; align-items: center; flex-wrap: wrap; }
.spread { justify-content: space-between; }

.btn {
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    border: 1px solid transparent;
    border-radius: 999px;
    padding: .55rem 1.1rem;
    font: inherit;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    background: var(--indigo);
    color: #fff;
}

.btn:hover { background: var(--indigo-600); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.secondary { background: var(--surface); color: var(--indigo); border-color: var(--line); }
.btn.secondary:hover { background: var(--indigo-100); }
.btn.accent { background: var(--lime); color: var(--indigo); }
.btn.accent:hover { filter: brightness(.95); }
.btn.danger { background: var(--surface); color: var(--danger); border-color: var(--danger); }
.btn.link { background: none; color: var(--indigo-600); padding: 0; border: 0; font-weight: 500; }

label { display: block; font-weight: 500; margin-bottom: .25rem; }

input:not([type]), input[type=text], input[type=email], input[type=tel], input[type=number],
input[type=date], input[type=time], input[type=datetime-local], select {
    width: 100%;
    max-width: 28rem;
    font: inherit;
    color: var(--text);
    padding: .6rem .8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: #fff;
}

input:focus, select:focus, .btn:focus-visible { outline: 3px solid var(--lime); outline-offset: 1px; }

input.code { letter-spacing: .3em; font-size: 1.4rem; max-width: 12rem; text-align: center; }

.field { margin-bottom: 1rem; }
.validation-message, .error { color: var(--danger); font-size: .9rem; }

.alert { border-radius: 10px; padding: .75rem 1rem; margin-bottom: 1rem; }
.alert.error { background: var(--danger-100); }
.alert.info { background: var(--lime-200); color: var(--indigo); }

.badge {
    display: inline-block;
    padding: .1rem .55rem;
    border-radius: 999px;
    font-size: .8rem;
    font-weight: 600;
    background: var(--indigo-100);
    color: var(--indigo);
}

.badge.lime { background: var(--lime); }
.badge.warn { background: #fff2cc; color: #7a5b00; }
.badge.danger { background: var(--danger-100); color: var(--danger); }

/* ---------- Termine ---------- */

.day-head { font-weight: 600; color: var(--muted); text-transform: uppercase; font-size: .8rem; letter-spacing: .05em; margin: 1.5rem 0 .5rem; }

.appointment { display: grid; grid-template-columns: 5.5rem 1fr auto; gap: 1rem; align-items: start; }
.appointment .time { font-weight: 600; font-size: 1.1rem; }
.appointment.cancelled { opacity: .6; }
.appointment.cancelled .time { text-decoration: line-through; }

.courts { display: grid; grid-template-columns: repeat(auto-fill, minmax(12rem, 1fr)); gap: .5rem; margin-top: .5rem; }
.court { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .75rem; }
.court .label { font-size: .8rem; color: var(--muted); }
.court .me, .players .me { font-weight: 700; }
.court .me::before, .players .me::before { content: "● "; color: var(--lime); }
.players { list-style: none; margin: 0; padding: 0; }

.group-list a { display: flex; justify-content: space-between; align-items: center; text-decoration: none; color: inherit; }

/* ---------- Verwaltung ---------- */

.tabs { display: flex; gap: .25rem; flex-wrap: wrap; margin: 0 0 1.25rem; border-bottom: 1px solid var(--line); }
.tabs a { text-decoration: none; color: var(--muted); padding: .5rem .9rem; border-bottom: 3px solid transparent; font-weight: 500; }
.tabs a:hover { color: var(--indigo); }
.tabs a.active { color: var(--indigo); border-bottom-color: var(--lime); }

.grid-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); gap: .75rem 1rem; align-items: end; }
.grid-form .field { margin: 0; }
.grid-form input, .grid-form select { max-width: none; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 400; }
.check input { width: 1.1rem; height: 1.1rem; accent-color: var(--indigo); }

.qr { width: 220px; height: 220px; background: #fff; border-radius: 10px; border: 1px solid var(--line); padding: .5rem; }
.code-display { font-size: 1.8rem; font-weight: 600; letter-spacing: .12em; }

.score { display: grid; grid-template-columns: repeat(auto-fill, minmax(13rem, 1fr)); gap: .25rem 1rem; }
.score .zero { color: var(--muted); }
.conflicts li { margin-bottom: .25rem; }
.variant { cursor: pointer; }
.variant.selected { outline: 3px solid var(--lime); }
.seat-editor select { max-width: 12rem; margin-bottom: .25rem; }

/* ---------- Verfügbarkeit ---------- */

.availability-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(10.5rem, 1fr)); gap: .4rem; }

.slot {
    display: flex;
    align-items: center;
    gap: .5rem;
    font-weight: 500;
    margin: 0;
    padding: .45rem .6rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer;
    background: #fff;
}

.slot input { accent-color: var(--indigo); width: 1.1rem; height: 1.1rem; }
.slot.blocked { background: var(--danger-100); border-color: #f2c4bf; color: var(--danger); }
.slot.blocked span { text-decoration: line-through; }

table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { text-align: left; padding: .5rem .4rem; border-bottom: 1px solid var(--line); vertical-align: top; }
table.list th { font-size: .8rem; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }

/* ---------- Anmeldung ---------- */

.auth { max-width: 26rem; margin: 3rem auto; }
.auth .logo { display: block; height: 44px; margin: 0 auto 1.5rem; }

/* ---------- Fehleranzeige von Blazor ---------- */

#blazor-error-ui {
    background: var(--lime-200);
    bottom: 0;
    box-shadow: 0 -1px 2px rgba(0, 0, 0, .2);
    display: none;
    left: 0;
    padding: .6rem 1.25rem .7rem;
    position: fixed;
    width: 100%;
    z-index: 1000;
}

#blazor-error-ui .dismiss { cursor: pointer; position: absolute; right: .75rem; top: .5rem; }

@media (max-width: 640px) {
    .appointment { grid-template-columns: 4.5rem 1fr; }
    .appointment > :last-child { grid-column: 1 / -1; }
    .topbar { gap: .75rem; }
}
.indent { margin-left: 1.6rem; }
