/* Fotoarchiv – gemeinsames Stylesheet für Verwaltung (index.php) und Gäste-Seite (event.php).
   Farbwelt: Abend auf einer Feier – tiefes Pflaumen-Violett, warmes Kerzen-Bernstein. */

:root {
    --nacht:        #2b2140;   /* Seitenhintergrund */
    --nacht-tief:   #221a33;   /* Fußbereich, Vertiefungen */
    --karte:        #362a52;   /* Kartenflächen */
    --linie:        #4a3d6b;   /* Ränder, Trenner */
    --schrift:      #f3eee4;   /* Haupttext, warmes Elfenbein */
    --schrift-matt: #b3a8cd;   /* Nebentext, Flieder */
    --akzent:       #e8b04b;   /* Bernstein – Buttons, Fokus */
    --akzent-tief:  #46350f;   /* Text auf Bernstein */
    --gut:          #8fce9f;
    --gut-flaeche:  #2e4a38;
    --schlecht:     #eb9180;
    --schlecht-flaeche: #55302c;
}

* { box-sizing: border-box; }

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

body {
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: var(--nacht);
    background-image: radial-gradient(ellipse 90% 55% at 50% -10%, #453462 0%, var(--nacht) 70%);
    color: var(--schrift);
    font-family: ui-rounded, "SF Pro Rounded", "Segoe UI", system-ui, -apple-system, sans-serif;
    line-height: 1.55;
    padding: 1.25rem 1rem 0;
}

/* Die Verwaltung (Landing Page) erscheint in Blau; die Event-Seiten
   bekommen ihre Farbwelt pro Event als Inline-Style aus event.php. */
body.verwaltung {
    --nacht: #1e2a47;
    --nacht-tief: #18223a;
    --karte: #28365c;
    --linie: #3a4c7d;
    --schrift-matt: #a3b1d6;
    background-image: radial-gradient(ellipse 90% 55% at 50% -10%, #2f4070 0%, var(--nacht) 70%);
}

main {
    width: 100%;
    max-width: 34rem;
    margin: 0 auto;
    flex: 1;
}

body.event main.schmal-mittig { max-width: 26rem; }

h1, h2 { line-height: 1.2; margin: 0 0 .5rem; font-weight: 700; }
h2 { font-size: 1.15rem; }
p  { margin: 0 0 1rem; }
p:last-child { margin-bottom: 0; }
a  { color: var(--akzent); }

.mittig { text-align: center; }

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

.kopf {
    max-width: 34rem;
    margin: 0 auto 1.75rem;
}

.marke {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: .01em;
    color: var(--schrift);
    text-decoration: none;
}

.untertitel {
    margin: .15rem 0 0;
    color: var(--schrift-matt);
}

.fuss {
    margin: 2.5rem -1rem 0;
    padding: 1rem;
    text-align: center;
    font-size: .85rem;
    color: var(--schrift-matt);
    background: var(--nacht-tief);
}

/* ---------- Karten und Meldungen ---------- */

.karte {
    background: var(--karte);
    border: 1px solid var(--linie);
    border-radius: 18px;
    padding: 1.4rem 1.3rem;
    margin-bottom: 1.25rem;
}

.karte > p { color: var(--schrift-matt); }

.meldung {
    border-radius: 14px;
    padding: .85rem 1.1rem;
    margin-bottom: 1.25rem;
}

.meldung-ok      { background: var(--gut-flaeche); color: var(--gut); }
.meldung-fehler  { background: var(--schlecht-flaeche); color: var(--schlecht); }

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

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

.feld span {
    display: block;
    font-size: .9rem;
    color: var(--schrift-matt);
    margin-bottom: .3rem;
}

.feld.schmal { max-width: 20rem; margin-top: 1rem; }

/* Auf der Gäste-Seite sind alle Texte mittig – auch die Beschriftung
   des Namensfelds und der Hinweis darunter. */
body.event .feld span,
body.event .feld-hinweis {
    text-align: center;
}

input[type="text"],
input[type="password"],
select {
    width: 100%;
    padding: .7rem .85rem;
    font: inherit;
    color: var(--schrift);
    background: var(--nacht-tief);
    border: 1px solid var(--linie);
    border-radius: 12px;
}

select { cursor: pointer; }

input.code-eingabe {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    letter-spacing: .08em;
    text-transform: uppercase;
}

input.fehlt {
    border-color: var(--schlecht);
}

.feld-hinweis {
    color: var(--schlecht);
    font-size: .88rem;
    margin: -.5rem 0 1rem;
}

input:focus-visible,
button:focus-visible,
.dropzone:focus-visible,
a:focus-visible {
    outline: 3px solid var(--akzent);
    outline-offset: 2px;
}

button {
    font: inherit;
    font-weight: 700;
    color: var(--akzent-tief);
    background: var(--akzent);
    border: 0;
    border-radius: 12px;
    padding: .7rem 1.3rem;
    cursor: pointer;
}

button:hover { filter: brightness(1.06); }

button.klein {
    font-weight: 600;
    font-size: .85rem;
    padding: .4rem .8rem;
    background: transparent;
    color: var(--akzent);
    border: 1px solid var(--linie);
}

/* ---------- Verwaltung: Event-Liste ---------- */

.event-liste {
    list-style: none;
    margin: 0 0 .5rem;
    padding: 0;
}

.event-zeile {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem .25rem;
    border-top: 1px solid var(--linie);
}

.event-zeile:last-child { border-bottom: 1px solid var(--linie); }

.event-code {
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-weight: 700;
    letter-spacing: .05em;
    text-decoration: none;
}

.event-zeile.beendet .event-code { color: var(--schrift-matt); }

.event-status {
    display: block;
    font-size: .82rem;
    color: var(--schrift-matt);
}

/* ---------- Gäste-Seite: Code als Hero ---------- */

/* Helle Vorlagen (Hochzeit, Taufe, …) brauchen dunklere Status-Farben
   und keinen Leucht-Effekt hinter dem Code. */
body.hell {
    --gut: #256b39;
    --gut-flaeche: #ddefe0;
    --schlecht: #a63a28;
    --schlecht-flaeche: #f6ded7;
}

body.hell .code-anzeige { text-shadow: none; }

.event-icon {
    text-align: center;
    font-size: 2.8rem;
    line-height: 1;
    margin: 1.25rem 0 0;
}

.hallo {
    text-align: center;
    color: var(--schrift-matt);
    margin: .5rem 0 .2rem;
}

.code-anzeige {
    text-align: center;
    font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
    font-size: clamp(1.7rem, 9vw, 2.6rem);
    letter-spacing: .1em;
    margin: 0 0 1.5rem;
    color: var(--akzent);
    text-shadow: 0 0 28px rgba(232, 176, 75, .35);
    /* Leuchtfarbe folgt dem Akzent der Vorlage (ältere Browser behalten die Zeile darüber). */
    text-shadow: 0 0 28px color-mix(in srgb, var(--akzent) 40%, transparent);
    overflow-wrap: anywhere;
}

/* ---------- Upload-Bereich ---------- */

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .35rem;
    padding: 2rem 1rem;
    margin: 1.25rem 0 1rem;
    text-align: center;
    color: var(--schrift);
    background: var(--nacht-tief);
    border: 2px dashed var(--linie);
    border-radius: 16px;
    cursor: pointer;
}

.dropzone svg { color: var(--akzent); margin-bottom: .3rem; }
.dropzone strong { font-size: 1.05rem; }
.dropzone span { font-size: .85rem; color: var(--schrift-matt); }

.dropzone.aktiv,
.dropzone:hover { border-color: var(--akzent); }

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

.upload-liste li {
    padding: .6rem 0;
    border-top: 1px solid var(--linie);
    font-size: .9rem;
}

.zeile-kopf {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: .35rem;
}

.datei-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.datei-status { flex-shrink: 0; color: var(--schrift-matt); }

.upload-liste li.fertig .datei-status { color: var(--gut); }
.upload-liste li.fehler .datei-status { color: var(--schlecht); }

.balken {
    height: 6px;
    border-radius: 3px;
    background: var(--nacht-tief);
    overflow: hidden;
}

.balken-fuellung {
    width: 0;
    height: 100%;
    background: var(--akzent);
    border-radius: 3px;
    transition: width .25s ease;
}

.upload-liste li.fertig .balken-fuellung { background: var(--gut); }

.nochmal, .entfernen { margin-top: .5rem; }

button.voll[hidden] { display: none; }

button.voll {
    display: block;
    width: 100%;
    margin-top: 1rem;
    padding: .85rem 1rem;
    font-size: 1.02rem;
}

button.voll:disabled {
    opacity: .65;
    cursor: default;
}

.zaehler {
    text-align: center;
    color: var(--schrift-matt);
    font-size: .9rem;
    margin: 1rem 0 0;
}

/* ---------- QR-Karte ---------- */

.qr-kachel {
    display: inline-block;
    padding: 14px;
    background: #ffffff;
    border-radius: 14px;
    margin: .5rem 0 1rem;
    line-height: 0;
}

.qr-kachel img, .qr-kachel canvas { max-width: 100%; }

.gaeste-link {
    font-size: .82rem;
    overflow-wrap: anywhere;
    color: var(--schrift-matt);
}

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