/* =====================================================================
   Submit — gemeinsame Gestaltung
   ---------------------------------------------------------------------
   Farben, Schrift, Abstände, Grundbausteine. Gilt für alle Module, damit
   der Übergang von einem ins andere nicht auffällt.

   Aufbau: 1) Marken  2) Grundlagen  3) Bausteine  4) Dunkel  5) Druck
   ===================================================================== */

/* Die Farbwerte stehen in ../../ui/tokens.css — derselben Datei, aus der
   SubmitOne, Submit Paper und Submit PDF lesen. Hier stehen nur noch die
   deutschen Namen, unter denen SubZeit und die Projektmappe sie kennen.

   Bis zum 14.08.2026 standen die Werte hier ein zweites Mal. Sie waren
   fast gleich — drei liefen auseinander: --kante war #e0e0ea statt
   #d3d3e0, --kante-stark #c2c2d4 statt #b6b6c8, --grund #f4f4f8 statt
   #eeeef5. Nebeneinander sah man es, erklären konnte es niemand. */
@import url("../../ui/tokens.css");

/* ---------- 1) Marken ------------------------------------------------ */

:root {
    /* Die Violettstufen --v-50 … --v-900 kommen aus der gemeinsamen Datei. */

    --flaeche:    var(--surface);
    --flaeche-2:  var(--surface-2);
    --flaeche-3:  var(--grund);
    --kante:      var(--line);
    --kante-stark:var(--line-stark);

    /* Drei klar getrennte Schriftstufen. Liegen sie zu nah beieinander,
       wirken sie wie eine einzige. */
    --text:       var(--ink);        /* 17.6:1 */
    --text-leise: var(--ink-soft);   /*  8.5:1 */
    --text-still: var(--ink-faint);  /*  4.8:1 */

    --gut:     #0f7a4a;  --gut-weich:     #e3f6ec;
    --warnung: #9a6206;  --warnung-weich: #fdf1dc;
    --gefahr:  var(--danger);  --gefahr-weich:  #fdeaea;
    --info:    #1d5fbf;  --info-weich:    #e7effc;

    --schatten-xs: 0 1px 2px rgba(30, 24, 60, .05);
    --schatten-s:  0 1px 2px rgba(30, 24, 60, .05), 0 2px 8px rgba(30, 24, 60, .06);
    --schatten-m:  0 2px 4px rgba(30, 24, 60, .05), 0 8px 24px rgba(30, 24, 60, .09);
    --schatten-l:  0 4px 8px rgba(30, 24, 60, .06), 0 20px 48px rgba(30, 24, 60, .16);

    --ring: 0 0 0 3px rgba(113, 50, 227, .30);

    --t-2xs: .6875rem;
    --t-xs:  .75rem;
    --t-s:   .8125rem;
    --t-m:   .875rem;
    --t-l:   1rem;
    --t-xl:  1.25rem;
    --t-2xl: 1.75rem;
    --t-3xl: 2.25rem;

    --s-1: .25rem;  --s-2: .5rem;   --s-3: .75rem;
    --s-4: 1rem;    --s-5: 1.5rem;  --s-6: 2rem;

    --schrift: var(--font);
    --schrift-marke: var(--font-brand);

    --weich: cubic-bezier(.32, .72, 0, 1);
}

/* ---------- 2) Grundlagen -------------------------------------------- */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
    margin: 0;
    font-family: var(--schrift);
    font-size: 16px;
    line-height: 1.5;
    color: var(--text);
    background: var(--grund);
    -webkit-font-smoothing: antialiased;
}

body, .inhalt { font-size: var(--t-m); }

h1, h2, h3 { margin: 0; font-weight: 640; letter-spacing: -.02em; line-height: 1.2; }
h1 { font-size: var(--t-xl); }
h2 { font-size: var(--t-l); }
h3 { font-size: var(--t-m); }
p  { margin: 0 0 .625rem; }
p:last-child { margin-bottom: 0; }

.abstand { flex: 1; }
.leise   { color: var(--text-leise); }
.still   { color: var(--text-still); }
.klein   { font-size: var(--t-xs); }
.zahl    { font-variant-numeric: tabular-nums; }
.zahl.gut   { color: var(--gut); font-weight: 620; }
.zahl.fehlt { color: var(--gefahr); font-weight: 620; }
.spalte  { display: flex; flex-direction: column; gap: var(--s-2); }
.zeile   { display: flex; align-items: center; gap: var(--s-2); }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--rund-s); }

/* ---------- 3) Bausteine --------------------------------------------- */

.knopf {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    padding: .4375rem .875rem;
    border: 1px solid var(--kante);
    border-radius: var(--rund);
    background: var(--flaeche);
    color: var(--text);
    font: inherit;
    font-size: var(--t-s);
    font-weight: 560;
    cursor: pointer;
    white-space: nowrap;
    transition: background .12s var(--weich), border-color .12s var(--weich);
}
.knopf:hover:not(:disabled) { background: var(--flaeche-3); border-color: var(--kante-stark); }
.knopf:disabled { opacity: .4; cursor: default; }

.knopf-haupt { background: var(--v-600); border-color: var(--v-600); color: #fff; }
.knopf-haupt:hover:not(:disabled) { background: var(--v-700); border-color: var(--v-700); }

.knopf-still { background: transparent; }
.knopf-winzig { padding: .1875rem .4375rem; font-size: var(--t-xs); }

.knopf-gefahr { background: var(--gefahr); border-color: var(--gefahr); color: #fff; }
.knopf-gefahr-still { border-color: transparent; color: var(--gefahr); background: transparent; }
.knopf-gefahr-still:hover { background: var(--gefahr-weich); }

.knopfgruppe { display: inline-flex; }
.knopfgruppe .knopf { border-radius: 0; margin-left: -1px; }
.knopfgruppe .knopf:first-child { border-radius: var(--rund) 0 0 var(--rund); margin-left: 0; }
.knopfgruppe .knopf:last-child  { border-radius: 0 var(--rund) var(--rund) 0; }

/* Segmentwahl: 1 · 3 · 5 · 7 */
.wahl {
    display: inline-flex;
    padding: 2px;
    border: 1px solid var(--kante);
    border-radius: var(--rund);
    background: var(--flaeche-2);
}
.wahl button {
    min-width: 30px;
    padding: .25rem .5rem;
    border: 0;
    border-radius: var(--rund-s);
    background: transparent;
    color: var(--text-leise);
    font: inherit;
    font-size: var(--t-s);
    font-weight: 560;
    cursor: pointer;
}
.wahl button.aktiv { background: var(--flaeche); color: var(--text); box-shadow: var(--schatten-xs); }

.karte {
    border: 1px solid var(--kante);
    border-radius: var(--rund-l);
    background: var(--flaeche);
    box-shadow: var(--schatten-xs);
    overflow: hidden;
}
.karte-kopf {
    display: flex;
    align-items: center;
    gap: var(--s-2);
    padding: .625rem .875rem;
    border-bottom: 1px solid var(--kante);
    background: var(--flaeche-2);
}
.karte-leib { padding: .875rem; display: flex; flex-direction: column; gap: .625rem; }
.karte.leer { padding: 2rem; text-align: center; }

.eingabe {
    width: 100%;
    padding: .4375rem .625rem;
    border: 1px solid var(--kante);
    border-radius: var(--rund);
    background: var(--flaeche);
    color: var(--text);
    font: inherit;
    font-size: var(--t-m);
}
.eingabe:focus { outline: none; border-color: var(--v-600); box-shadow: var(--ring); }
.eingabe.schmal { width: auto; font-size: var(--t-xs); padding: .1875rem .375rem; }
.eingabe.farbe { padding: 2px; height: 34px; }

.feld { display: block; }
.feld + .feld { margin-top: .625rem; }
.feld-name { display: block; margin-bottom: .25rem; font-size: var(--t-s); font-weight: 560; }
.feld-name em { font-style: normal; font-weight: 400; color: var(--text-still); margin-left: .25rem; }

.form-zwei { display: grid; grid-template-columns: 1fr 1fr; gap: .625rem; margin-top: .625rem; }
.form-zwei .feld + .feld { margin-top: 0; }

.tabelle { width: 100%; border-collapse: collapse; font-size: var(--t-s); }
.tabelle th {
    text-align: left;
    padding: .5rem .75rem;
    border-bottom: 1px solid var(--kante);
    background: var(--flaeche-2);
    font-size: var(--t-2xs);
    text-transform: uppercase;
    letter-spacing: .04em;
    color: var(--text-still);
}
.tabelle td { padding: .5rem .75rem; border-bottom: 1px solid var(--kante); vertical-align: top; }
.tabelle tr:last-child td { border-bottom: 0; }
.tabelle .zahl { text-align: right; font-variant-numeric: tabular-nums; }

.punkt { display: inline-block; width: 9px; height: 9px; border-radius: 50%; }
.punkt.voll { background: var(--gut); }
.punkt.teil { background: var(--warnung); }

.kacheln { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: var(--s-3); }
.kachel {
    padding: .875rem 1rem;
    border: 1px solid var(--kante);
    border-radius: var(--rund-l);
    background: var(--flaeche);
}
.kachel-name { font-size: var(--t-2xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-still); font-weight: 700; }
.kachel-wert { margin-top: .1875rem; font-size: var(--t-2xl); font-weight: 640; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.kachel-wert.gut { color: var(--gut); }
.kachel-wert.fehlt { color: var(--gefahr); }
.kachel-hinweis { font-size: var(--t-xs); color: var(--text-still); }

/* Kurzmeldungen */
.meldungen {
    position: fixed;
    left: 50%;
    bottom: 1.25rem;
    transform: translateX(-50%);
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: .5rem;
    pointer-events: none;
}
.meldung {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .5rem .875rem;
    border-radius: var(--rund-l);
    background: var(--text);
    color: #fff;
    font-size: var(--t-s);
    box-shadow: var(--schatten-m);
    pointer-events: auto;
    transition: opacity .25s var(--weich);
}
.meldung.gut     { background: var(--gut); }
.meldung.warnung { background: var(--warnung); }
.meldung-tat {
    border: 0;
    border-radius: var(--rund-s);
    padding: .1875rem .5rem;
    background: rgba(255, 255, 255, .22);
    color: #fff;
    font: inherit;
    font-size: var(--t-xs);
    font-weight: 620;
    cursor: pointer;
}

/* Fenster */
.schleier {
    position: fixed;
    inset: 0;
    z-index: 150;
    display: grid;
    place-items: center;
    padding: 1.25rem;
    background: rgba(20, 14, 46, .52);
    backdrop-filter: blur(3px);
    overflow-y: auto;
}
.fenster {
    width: min(480px, 100%);
    margin: auto;
    border-radius: var(--rund-xl);
    background: var(--flaeche);
    box-shadow: var(--schatten-l);
    overflow: hidden;
}
.fenster.breit { width: min(760px, 100%); }
.fenster-kopf {
    display: flex;
    align-items: flex-start;
    gap: var(--s-3);
    padding: 1rem 1.125rem;
    border-bottom: 1px solid var(--kante);
}
.fenster-kopf h2 { font-size: var(--t-l); }
.fenster-unterzeile { margin: .125rem 0 0; font-size: var(--t-xs); color: var(--text-still); }
.fenster-zu {
    margin-left: auto;
    width: 28px; height: 28px;
    border: 0; border-radius: 50%;
    background: transparent; color: var(--text-still);
    font-size: 1.25rem; line-height: 1; cursor: pointer;
}
.fenster-zu:hover { background: var(--flaeche-3); color: var(--text); }
.fenster-inhalt { padding: 1.125rem; }
.fenster-fuss {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .875rem 1.125rem;
    border-top: 1px solid var(--kante);
    background: var(--flaeche-2);
}

/* Kontextmenü */
.menue-schleier { position: fixed; inset: 0; z-index: 160; }
.menue {
    position: fixed;
    z-index: 161;
    min-width: 230px;
    max-width: 300px;
    padding: .3125rem;
    border: 1px solid var(--kante);
    border-radius: var(--rund-l);
    background: var(--flaeche);
    box-shadow: var(--schatten-l);
}
.menue-kopf { display: flex; gap: .5rem; padding: .5rem .625rem .625rem; border-bottom: 1px solid var(--kante); }
.menue-punkt {
    display: block;
    width: 100%;
    padding: .4375rem .625rem;
    border: 0;
    border-radius: var(--rund);
    background: transparent;
    color: var(--text);
    font: inherit;
    font-size: var(--t-s);
    text-align: left;
    cursor: pointer;
}
.menue-punkt:hover { background: var(--flaeche-3); }
.menue-punkt.gefahr { color: var(--gefahr); font-weight: 560; }
.menue-punkt.gefahr:hover { background: var(--gefahr-weich); }
.menue-trenner { height: 1px; margin: .3125rem 0; background: var(--kante); }
.menue-titel { padding: .3125rem .625rem 0; font-size: var(--t-2xs); text-transform: uppercase; letter-spacing: .05em; color: var(--text-still); font-weight: 700; }
.menue-chips { display: flex; flex-wrap: wrap; gap: .25rem; padding: .375rem .625rem .5rem; }
.chip {
    padding: .1875rem .5rem;
    border: 1px solid var(--kante);
    border-radius: 999px;
    background: var(--flaeche-2);
    font: inherit;
    font-size: var(--t-2xs);
    cursor: pointer;
}
.chip:hover { border-color: var(--v-600); color: var(--v-700); }

/* ---------- 4) Dunkel ------------------------------------------------ */

@media (prefers-color-scheme: dark) {
    :root {
        --grund:      #100f18;
        --flaeche:    #171621;
        --flaeche-2:  #1e1c2b;
        --flaeche-3:  #262336;
        --kante:      #2c2940;
        --kante-stark:#453f60;

        --text:       #eeecf6;
        --text-leise: #a9a4c2;
        --text-still: #7d78a0;

        --gut:     #55c98e;  --gut-weich:     #10301f;
        --warnung: #e0ab54;  --warnung-weich: #322311;
        --gefahr:  #f0837d;  --gefahr-weich:  #3a1a1c;
        --info:    #7fb0f0;  --info-weich:    #15233a;

        --ring: 0 0 0 3px rgba(160, 132, 247, .40);
        --schatten-xs: 0 1px 2px rgba(0, 0, 0, .35);
        --schatten-s:  0 1px 2px rgba(0, 0, 0, .35), 0 2px 8px rgba(0, 0, 0, .3);
        --schatten-m:  0 2px 4px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .4);
        --schatten-l:  0 4px 8px rgba(0, 0, 0, .35), 0 20px 48px rgba(0, 0, 0, .5);
    }
    .meldung { background: var(--flaeche-3); color: var(--text); border: 1px solid var(--kante); }
    .knopf-haupt, .knopf-gefahr { color: #fff; }
}

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

/* ---------- 5) Druck ------------------------------------------------- */

@media print {
    .kopfleiste, .seitenleiste, .meldungen, .wahl, .knopfgruppe, .knopf { display: none !important; }
    body { background: #fff; }
    .karte { border: 1px solid #ccc; box-shadow: none; break-inside: avoid; }
    @page { margin: 15mm; }
}
