/* =========================================================================
   Lauftreff Kuppingen – Staffellauf Paris
   Styles nach Brand Guide (styleguide.md). Alles lokal, keine CDNs.
   ========================================================================= */

/* --- Schrift: Rubik, lokal eingebunden (DSGVO) --- */
@font-face {
    font-family: 'Rubik';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/assets/fonts/rubik-300-latin.woff2') format('woff2');
}
@font-face {
    font-family: 'Rubik';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/rubik-400-latin.woff2') format('woff2');
}
@font-face {
    font-family: 'Rubik';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('/assets/fonts/rubik-400-italic-latin.woff2') format('woff2');
}
@font-face {
    font-family: 'Rubik';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/assets/fonts/rubik-500-latin.woff2') format('woff2');
}
@font-face {
    font-family: 'Rubik';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/assets/fonts/rubik-700-latin.woff2') format('woff2');
}
@font-face {
    font-family: 'Rubik';
    font-style: italic;
    font-weight: 900;
    font-display: swap;
    src: url('/assets/fonts/rubik-900-italic-latin.woff2') format('woff2');
}

/* --- Design-Tokens (aus dem Styleguide) --- */
:root {
    --c-blue: #1E5BA8;
    --c-blue-deep: #154078;
    --c-blue-darker: #0D2B52;
    --c-sky: #6BA8DC;
    --c-sun: #F5B82E;
    --c-sun-deep: #E0A21A;
    --c-orange: #E8501F;
    --c-orange-deep: #C13F12;
    --c-ink: #14171F;
    --c-text: #383E4D;
    --c-muted: #6F7585;
    --c-paper: #FFFFFF;
    --c-cream: #F2F4F7;
    --c-pale-blue: #E8F1FA;
    --c-pale-yellow: #FCF2D5;

    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 2px 8px rgba(13, 43, 82, 0.08);
    --shadow-lg: 0 8px 30px rgba(13, 43, 82, 0.14);
    --maxw: 960px;
}

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

html { -webkit-text-size-adjust: 100%; }

body {
    margin: 0;
    font-family: 'Rubik', system-ui, -apple-system, sans-serif;
    font-weight: 400;
    color: var(--c-text);
    background: var(--c-cream);
    line-height: 1.55;
    font-size: clamp(15px, 1rem + 0.1vw, 17px);
}

h1, h2, h3 {
    font-style: italic;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--c-blue-darker);
    line-height: 1.12;
    margin: 0 0 0.5em;
}
h1 { font-size: clamp(1.8rem, 1.2rem + 3vw, 3rem); }
h2 { font-size: clamp(1.35rem, 1rem + 1.6vw, 2rem); }
h3 { font-size: clamp(1.1rem, 1rem + 0.6vw, 1.35rem); }

a { color: var(--c-blue); }
a[href^="mailto:"] { white-space: nowrap; }
a:hover { color: var(--c-blue-deep); }

p { margin: 0 0 1rem; }

/* --- Layout --- */
.container { width: min(100% - 2rem, var(--maxw)); margin-inline: auto; }

.site-header {
    background: var(--c-blue);
    color: #fff;
    background-image: linear-gradient(160deg, var(--c-blue) 0%, var(--c-blue-deep) 100%);
}
.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 0;
}
.site-header a { color: #fff; text-decoration: none; }
.site-header .logo img { height: 46px; display: block; }
.site-header nav { display: flex; gap: 1.2rem; font-weight: 500; }
.site-header nav a:hover { color: var(--c-sun); }

.hero {
    position: relative;
    background: var(--c-blue);
    background-image: linear-gradient(160deg, var(--c-blue) 0%, var(--c-blue-darker) 100%);
    color: #fff;
    overflow: hidden;
}
.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: url('/assets/img/hero-pattern.svg') center/620px repeat;
    opacity: 0.10;
    pointer-events: none;
}
.hero .container { position: relative; padding: clamp(2.5rem, 6vw, 5rem) 0; z-index: 1; }
.hero h1 { color: #fff; max-width: 18ch; }
.hero .lead { font-size: 1.2rem; max-width: 46ch; color: rgba(255,255,255,0.92); }
.hero .kicker {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 500;
    font-size: 0.8rem;
    color: var(--c-sun);
    margin-bottom: 0.6rem;
}

main { padding: clamp(1.5rem, 4vw, 3rem) 0; }

.card {
    background: var(--c-paper);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: clamp(1.2rem, 3vw, 2rem);
    margin-bottom: 1.5rem;
}

.grid { display: grid; gap: 1.2rem; }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }

/* --- Buttons --- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: inherit;
    font-weight: 500;
    font-size: 1rem;
    padding: 0.7rem 1.4rem;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--c-blue);
    color: #fff;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, transform 0.05s;
}
.btn:hover { background: var(--c-blue-deep); color: #fff; }
.btn:active { transform: translateY(1px); }
.btn--cta { background: var(--c-orange); }
.btn--cta:hover { background: var(--c-orange-deep); }
.btn--ghost { background: transparent; color: var(--c-blue); border: 1.5px solid var(--c-blue); }
.btn--ghost:hover { background: var(--c-pale-blue); color: var(--c-blue-deep); }
.btn--sm { padding: 0.4rem 0.85rem; font-size: 0.9rem; }
.btn--danger { background: var(--c-orange-deep); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

/* --- Formulare --- */
.field { margin-bottom: 1.15rem; }
.field > label { display: block; font-weight: 500; margin-bottom: 0.35rem; color: var(--c-ink); }
.field .hint { font-size: 0.85rem; color: var(--c-muted); margin-top: 0.25rem; }
input[type=text], input[type=email], input[type=tel], input[type=date],
input[type=password], input[type=number], input[type=search], select, textarea {
    width: 100%;
    font-family: inherit;
    font-size: 1rem;
    padding: 0.6rem 0.75rem;
    border: 1.5px solid #cdd6e2;
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--c-ink);
}
input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--c-blue);
    box-shadow: 0 0 0 3px var(--c-pale-blue);
}
textarea { min-height: 110px; resize: vertical; }
.checkbox { display: flex; gap: 0.6rem; align-items: flex-start; margin-bottom: 0.8rem; }
.checkbox input { margin-top: 0.25rem; width: auto; flex: none; }
.radio-group { display: flex; flex-wrap: wrap; gap: 0.75rem; }
.radio-group label {
    display: flex; gap: 0.5rem; align-items: center;
    padding: 0.6rem 1rem; border: 1.5px solid #cdd6e2; border-radius: var(--radius-sm);
    cursor: pointer; font-weight: 500;
}
.radio-group input { width: auto; }
.radio-group input:checked + span { color: var(--c-blue); }
.honeypot { position: absolute; left: -9999px; top: -9999px; }

/* --- Wizard --- */
.wizard-steps {
    display: flex; flex-wrap: wrap; gap: 0.4rem; list-style: none;
    padding: 0; margin: 0 0 1.8rem; font-size: 0.85rem;
}
.wizard-steps li {
    padding: 0.3rem 0.7rem; border-radius: 999px; background: #e4ebf4; color: var(--c-muted);
}
.wizard-steps li.active { background: var(--c-blue); color: #fff; }
.wizard-steps li.done { background: var(--c-sky); color: #fff; }
.wizard-actions { display: flex; justify-content: space-between; gap: 1rem; margin-top: 1.5rem; }
.wizard-actions__back { order: 1; }
.wizard-actions__primary { order: 2; }

/* --- Meldungen --- */
.flash { padding: 0.85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 500; }
.flash--success { background: #e3f5e8; color: #1c6b34; }
.flash--error { background: #fbe4dd; color: var(--c-orange-deep); }
.flash--info { background: var(--c-pale-blue); color: var(--c-blue-deep); }
.notice { background: var(--c-pale-yellow); border-radius: var(--radius-sm); padding: 1rem 1.2rem; }

/* --- Badges (Status) --- */
.badge {
    display: inline-block; padding: 0.2rem 0.6rem; border-radius: 999px;
    font-size: 0.78rem; font-weight: 500; white-space: nowrap;
    background: #e4ebf4; color: var(--c-blue-deep);
}
.badge--green { background: #e3f5e8; color: #1c6b34; }
.badge--yellow { background: var(--c-pale-yellow); color: var(--c-sun-deep); }
.badge--orange { background: #fbe4dd; color: var(--c-orange-deep); }
.badge--grey { background: #e7e9ee; color: var(--c-muted); }
.badge--blue { background: var(--c-pale-blue); color: var(--c-blue); }

/* --- Tabellen --- */
.table-wrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
table.data th, table.data td { text-align: left; padding: 0.55rem 0.7rem; border-bottom: 1px solid #e6eaf1; }
table.data th { font-weight: 500; color: var(--c-muted); white-space: nowrap; }
table.data tr:hover td { background: var(--c-pale-blue); }

/* --- Footer --- */
.site-footer {
    background: var(--c-blue-darker); color: rgba(255,255,255,0.85);
    padding: 2rem 0; margin-top: 3rem; font-size: 0.9rem;
}
.site-footer a { color: var(--c-sky); }
.site-footer .container { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }

/* --- Girocode --- */
.girocode { text-align: center; }
.girocode svg { max-width: 240px; height: auto; background: #fff; padding: 8px; border-radius: var(--radius-sm); }

/* --- Kleinigkeiten --- */
.muted { color: var(--c-muted); }
.text-center { text-align: center; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }
.stack > * + * { margin-top: 1rem; }
.dl { display: grid; grid-template-columns: max-content 1fr; gap: 0.35rem 1.2rem; }
.dl dt { color: var(--c-muted); }
.dl dd { margin: 0; }
.bank-details { background: var(--c-pale-blue); border-radius: var(--radius-sm); padding: 1rem 1.2rem; }
.bank-details .iban { font-family: ui-monospace, 'SFMono-Regular', Menlo, monospace; font-weight: 500; letter-spacing: 0.02em; }

@media (max-width: 640px) {
    .site-header nav { gap: 0.8rem; font-size: 0.9rem; }
    .wizard-actions { flex-direction: column-reverse; }
    .wizard-actions .btn { width: 100%; justify-content: center; }
}

/* =========================================================================
   Admin-Bereich
   ========================================================================= */
.admin-body { background: var(--c-cream); min-height: 100vh; display: flex; flex-direction: column; }
.admin-shell { display: flex; flex: 1; align-items: stretch; }

.admin-sidebar {
    background: var(--c-blue-darker); color: rgba(255,255,255,0.9);
    width: 240px; flex: none; padding: 1.2rem 0; position: sticky; top: 0; height: 100vh;
    overflow-y: auto;
}
.admin-sidebar .brand { padding: 0 1.2rem 1rem; }
.admin-sidebar .brand img { height: 34px; }
.admin-sidebar nav { display: flex; flex-direction: column; }
.admin-sidebar nav a {
    color: rgba(255,255,255,0.82); text-decoration: none; padding: 0.6rem 1.2rem;
    font-weight: 500; font-size: 0.95rem; border-left: 3px solid transparent;
    display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
}
.admin-sidebar nav a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.admin-sidebar nav a.active { background: rgba(255,255,255,0.10); color: #fff; border-left-color: var(--c-sun); }
.admin-sidebar .nav-count { background: var(--c-orange); color: #fff; border-radius: 999px; padding: 0.05rem 0.5rem; font-size: 0.75rem; }
.admin-sidebar .section-label { text-transform: uppercase; font-size: 0.7rem; letter-spacing: 0.08em; color: rgba(255,255,255,0.45); padding: 1rem 1.2rem 0.3rem; }

.admin-main { flex: 1; min-width: 0; }
.admin-topbar {
    background: #fff; border-bottom: 1px solid #e6eaf1; padding: 0.8rem 1.5rem;
    display: flex; justify-content: space-between; align-items: center; gap: 1rem;
}
.admin-topbar .who { font-size: 0.9rem; color: var(--c-muted); }
.admin-content { padding: clamp(1rem, 3vw, 2rem); max-width: 1200px; }

.nav-toggle-btn {
    display: none; flex-direction: column; justify-content: center; gap: 4px;
    background: none; border: none; padding: 0.4rem; margin: -0.4rem; cursor: pointer;
}
.nav-toggle-btn span { display: block; width: 22px; height: 2px; background: var(--c-ink); border-radius: 2px; }
.admin-backdrop { display: none; }

.stat-tile {
    background: #fff; border-radius: var(--radius); box-shadow: var(--shadow);
    padding: 1.2rem; border-left: 4px solid var(--c-sky);
}
.stat-tile .num { font-size: 2rem; font-weight: 700; font-style: italic; color: var(--c-blue-darker); line-height: 1; }
.stat-tile .lbl { font-size: 0.85rem; color: var(--c-muted); margin-top: 0.3rem; }
.stat-tile.accent { border-left-color: var(--c-orange); }
.stat-tile.sun { border-left-color: var(--c-sun); }

.toolbar { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; margin-bottom: 1.2rem; }
.toolbar .field { margin-bottom: 0; }
.inline-form { display: inline; }

.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 900px) {
    .detail-grid { grid-template-columns: 1fr; }

    .nav-toggle-btn { display: inline-flex; }
    .admin-sidebar {
        position: fixed; top: 0; left: 0; height: 100vh; z-index: 60;
        max-width: 80vw; transform: translateX(-100%); transition: transform 0.25s ease;
    }
    .admin-shell.nav-open .admin-sidebar { transform: translateX(0); box-shadow: var(--shadow-lg); }
    .admin-shell.nav-open .admin-backdrop {
        display: block; position: fixed; inset: 0; background: rgba(13, 43, 82, 0.45); z-index: 55;
    }
}

.audit-log { list-style: none; padding: 0; margin: 0; font-size: 0.88rem; }
.audit-log li { padding: 0.5rem 0; border-bottom: 1px solid #eef1f6; }
.audit-log .ts { color: var(--c-muted); font-size: 0.8rem; }

.wish-graph-svg { width: 100%; height: auto; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.login-wrap { max-width: 400px; margin: 8vh auto; }
