/*
   lecker – Gestaltung
   Leitbild: Emaille-Geschirr (enamel). Kühles Weiß, kobaltblauer Rand, Senfgelb für Akzente.
*/

:root {
    --enamel: #fcfdfd;
    --tile: #e8edf2;
    --cobalt: #1d3f94;
    --cobalt-dark: #142c6b;
    --ink: #18203a;
    --muted: #5a6478;
    --line: #c9d2de;
    --danger: #b92c1c;
    --danger-light: #fbeae7;
    --success: #24693f;
    --success-light: #e6f3ea;
    --mustard: #e0ac2b;

    --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    --font-rounded: ui-rounded, "SF Pro Rounded", "Arial Rounded MT Bold", "Nunito", var(--font);

    --radius: 14px;
    --radius-small: 9px;
}

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

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

body {
    margin: 0;
    background: var(--tile);
    color: var(--ink);
    font-family: var(--font);
    font-size: 1.0625rem;
    line-height: 1.5;
}

h1,
h2 {
    font-family: var(--font-rounded);
    line-height: 1.15;
    margin: 0 0 0.6em;
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -0.01em;
}

h1:focus {
    outline: none;
}

h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

p {
    margin: 0 0 1em;
    max-width: 62ch;
}

a {
    color: var(--cobalt);
    text-underline-offset: 0.18em;
}

a:hover {
    color: var(--cobalt-dark);
}

:focus-visible {
    outline: 3px solid var(--mustard);
    outline-offset: 2px;
}

/* ---------- Wortmarke ---------- */

.wordmark {
    font-family: var(--font-rounded);
    font-weight: 800;
    font-size: 1.5rem;
    letter-spacing: -0.02em;
    color: #fff;
    text-decoration: none;
}

.wordmark:hover {
    color: #fff;
}

.wordmark-large {
    font-size: 3.25rem;
    color: var(--cobalt);
}

.wordmark-large:hover {
    color: var(--cobalt-dark);
}

/* ---------- Kopfleiste ---------- */

.topbar {
    background: var(--cobalt);
    color: #fff;
    padding-top: env(safe-area-inset-top);
}

.topbar-inner {
    max-width: 68rem;
    margin: 0 auto;
    padding: 0.6rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 1.5rem;
}

.topbar-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    flex: 1;
}

.topbar-nav a,
.topbar-user a,
.topbar-logout {
    color: #fff;
    text-decoration: none;
    font: inherit;
    font-weight: 600;
    padding: 0.35rem 0.7rem;
    border-radius: var(--radius-small);
    border: 0;
    background: transparent;
    cursor: pointer;
}

.topbar-nav a:hover,
.topbar-user a:hover,
.topbar-logout:hover {
    background: var(--cobalt-dark);
    color: #fff;
}

.topbar-nav a.active {
    background: var(--enamel);
    color: var(--cobalt);
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: auto;
}

.topbar-user form {
    margin: 0;
}

.topbar-logout {
    font-weight: 400;
    opacity: 0.85;
}

/* ---------- Seitenrahmen ---------- */

.page {
    max-width: 68rem;
    margin: 0 auto;
    padding: 2rem 1rem 4rem;
}

.panel,
.empty {
    background: var(--enamel);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1.4rem;
    margin-bottom: 1.5rem;
}

.empty {
    border-style: dashed;
    border-width: 2px;
    background: transparent;
}

/* ---------- Anmeldung: der Teller mit Emaille-Rand ---------- */

.gate {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 9vh 1.25rem 3rem;
    gap: 1.75rem;
}

.plate {
    width: 100%;
    max-width: 26rem;
    background: var(--enamel);
    border-radius: 26px;
    padding: 2rem 1.75rem 1.5rem;
    /* weißer Tellerrand, darum die blaue Emaille-Kante */
    box-shadow:
        0 0 0 7px var(--enamel),
        0 0 0 11px var(--cobalt);
}

.plate h1 {
    font-size: 1.6rem;
}

.gate-links {
    margin-top: 1.25rem;
    margin-bottom: 0.5rem;
}

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

.field {
    display: block;
    margin-bottom: 1rem;
}

.field > span {
    display: block;
    font-weight: 600;
    margin-bottom: 0.3rem;
}

.field small {
    display: block;
    color: var(--muted);
    font-size: 0.875rem;
    margin-top: 0.3rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input:not([type]),
select {
    width: 100%;
    font: inherit;
    color: inherit;
    background: #fff;
    border: 1.5px solid var(--line);
    border-radius: var(--radius-small);
    padding: 0.6rem 0.75rem;
    min-height: 2.9rem;
}

input:focus-visible,
select:focus-visible {
    border-color: var(--cobalt);
}

input.invalid {
    border-color: var(--danger);
}

.validation-message {
    color: var(--danger);
    font-size: 0.9rem;
    margin-top: 0.3rem;
}

.check {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    margin-bottom: 1.25rem;
}

.check input {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--cobalt);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0 1rem;
}

@media (min-width: 44rem) {
    .form-row {
        grid-template-columns: minmax(0, 1fr) 10rem 10rem;
    }
}

/* ---------- Knöpfe ---------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    color: var(--cobalt);
    background: #fff;
    border: 1.5px solid var(--cobalt);
    border-radius: var(--radius-small);
    padding: 0.55rem 1rem;
    min-height: 2.75rem;
    cursor: pointer;
}

.btn:hover {
    background: var(--tile);
}

.btn[disabled] {
    opacity: 0.55;
    cursor: default;
}

.btn-primary {
    background: var(--cobalt);
    color: #fff;
}

.btn-primary:hover {
    background: var(--cobalt-dark);
    border-color: var(--cobalt-dark);
    color: #fff;
}

.btn-wide {
    width: 100%;
}

.btn-quiet {
    border-color: transparent;
    background: transparent;
    padding: 0.4rem 0.7rem;
    min-height: 2.4rem;
}

.btn-quiet:hover {
    background: var(--tile);
}

.btn-danger {
    color: var(--danger);
}

.btn-danger:hover {
    background: var(--danger-light);
}

/* ---------- Hinweise ---------- */

.notice {
    border-radius: var(--radius-small);
    padding: 0.75rem 0.9rem;
    margin: 0 0 1rem;
    max-width: none;
    border-left: 5px solid;
}

.notice p {
    max-width: none;
    margin-bottom: 0.6rem;
}

.notice-error {
    background: var(--danger-light);
    border-color: var(--danger);
}

.notice-ok {
    background: var(--success-light);
    border-color: var(--success);
}

.hint {
    color: var(--muted);
    font-size: 0.95rem;
}

.panel > .notice:last-child,
.panel > :last-child {
    margin-bottom: 0;
}

.panel form + .notice {
    margin-top: 1.25rem;
}

.copy-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.copy-row input {
    flex: 1 1 16rem;
    font-size: 0.9rem;
}

/* ---------- Listen ---------- */

.rows {
    list-style: none;
    margin: 0;
    padding: 0;
}

.row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem 0.6rem;
    padding: 0.8rem 0;
    border-top: 1px solid var(--line);
}

.row:first-child {
    border-top: 0;
    padding-top: 0;
}

.row:last-child {
    padding-bottom: 0;
}

.row-main {
    flex: 1 1 16rem;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.row-main strong {
    overflow-wrap: anywhere;
}

.row-meta {
    color: var(--muted);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.tag {
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.15rem 0.6rem;
    border-radius: 999px;
    border: 1.5px solid var(--cobalt);
    color: var(--cobalt);
    white-space: nowrap;
}

.tag-ok {
    border-color: var(--success);
    color: var(--success);
}

.tag-muted {
    border-color: var(--line);
    color: var(--muted);
}

.tag-danger {
    border-color: var(--danger);
    color: var(--danger);
}

/* ---------- Blazor-Fehlerleiste ---------- */

#blazor-error-ui {
    display: none;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    padding: 0.8rem 3rem 0.8rem 1rem;
    background: var(--danger);
    color: #fff;
}

#blazor-error-ui a {
    color: #fff;
}

#blazor-error-ui .dismiss {
    position: absolute;
    right: 1rem;
    top: 0.75rem;
    cursor: pointer;
}

@media (max-width: 34rem) {
    h1 {
        font-size: 1.7rem;
    }

    .topbar-user {
        margin-left: 0;
        width: 100%;
        justify-content: space-between;
    }

    .page {
        padding-top: 1.25rem;
    }
}
