/*
 * Sicherer Datenabruf – Gestaltung 1:1 nach tohosis.ch (dateien/css/stil.css)
 * Schrift: Source Sans 3 (Google Fonts, im HTML eingebunden)
 */
:root {
    --text: #585858;
    --text-hell: #9a9a9a;
    --rand: #c9c9c9;
    --hintergrund: #ffffff;
    --akzent: #f2849e;
    --logo: #39454b;
    --logo-rot: #c74343;
    --button: rgba(199, 67, 67, .08);
    --button-rand: rgba(199, 67, 67, .35);
    --button-text: #a83636;
    --button-hover: #c74343;
    --footer-text: #3a1212;
    --s1: #f2849e;
    --s3: #7bd0c1;
    --grundschrift: 1.5em;
    --schrift: "Source Sans Pro", "Source Sans 3", Helvetica, Arial, sans-serif;
    /* Hintergrundfoto liegt in css/img/ (gleicher Dateiname wie auf tohosis.ch) */
    --hg-bild: url("img/muschelblume.jpg");
}

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

html { font-size: 16px; }
body {
    margin: 0;
    background: var(--hintergrund);
    color: var(--text);
    font-family: var(--schrift);
    font-weight: 500;
    line-height: 1.6;
    -webkit-text-size-adjust: none;
    display: flex; flex-direction: column; min-height: 100vh;
    position: relative;
}
main { flex: 1; }

/* Muschel-Mandala, dezent und langsam wandernd – wie auf tohosis.ch */
body::before {
    content: "";
    position: fixed; inset: -6%; z-index: -1;
    background: var(--hg-bild) no-repeat center / cover;
    opacity: .12;
    pointer-events: none;
    animation: holz-wandern 60s ease-in-out infinite alternate;
    will-change: transform;
}
@keyframes holz-wandern {
    from { transform: translate(-3%, -2%) scale(1); }
    to   { transform: translate(3%, 2%) scale(1.04); }
}

a { color: inherit; border-bottom: dotted 1px; text-decoration: none; transition: color .2s, border-color .2s; }
a:hover { color: var(--logo-rot); border-bottom-color: transparent; }
strong, b { font-weight: 700; color: inherit; }

h1, h2, h3 { color: inherit; line-height: 1.3; margin: 0 0 1em; }
h1 { font-size: 2.75em; font-weight: 900; letter-spacing: -.035em; }
h2 { font-size: 1.35em; font-weight: 700; letter-spacing: -.01em; margin-top: 2em; }
small { color: var(--text-hell); }

/* ---------- Layout ---------- */
.inner { max-width: 68em; width: 100%; margin: 0 auto; padding: 0 2.5em; }

.site-header {
    position: sticky; top: 0; z-index: 100;
    padding: 2em 0 1.2em;
    background: rgba(255, 255, 255, .9);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.site-header .inner { display: flex; align-items: center; justify-content: space-between; gap: 3em; }
main.inner { padding-top: 2.5em; padding-bottom: 6em; }

/* ---------- Logo (identisch tohosis.ch) ---------- */
.logo {
    display: flex; flex-direction: column; flex-shrink: 0;
    border: 0; color: var(--logo);
    font-family: "Source Sans Pro", "Source Sans 3", sans-serif;
    font-size: 60px; font-weight: 900; line-height: 1; letter-spacing: -3px;
}
.logo:hover { color: var(--logo) !important; }
.logo .rot { color: var(--logo-rot); }
.logo .zusatz {
    font-weight: normal; font-size: .45em; letter-spacing: -.5px;
    margin-top: -.15em; padding-left: .12em;
}
.header-action { display: flex; align-items: center; gap: 1em; margin: 0; }
.header-action .who { color: var(--text-hell); }

/* ---------- Abrufbereich: Grundschrift wie Fliesstext auf tohosis.ch ---------- */
.abruf p, .abruf .files li, .abruf label, .abruf input[type="password"] { font-size: var(--grundschrift); }
.abruf label { font-size: 1.2em; }
.abruf .secret-box pre { font-size: 1.25em; }
.abruf h2 { font-size: 1.6em; }

/* ---------- Formulare ---------- */
.card { margin: 2em 0; }
.form-group { margin-bottom: 1.8em; }
label { display: block; font-weight: 700; margin-bottom: .3em; color: var(--text); }

input[type="text"], input[type="password"], input[type="email"], textarea, select {
    appearance: none;
    width: 100%;
    background: transparent;
    border: 0; border-radius: 0;
    border-bottom: solid 1px var(--rand);
    color: inherit;
    font: inherit;
    padding: .5em 0;
    outline: 0;
    transition: border-color .2s;
}
textarea { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .95em; }
select {
    background-image: url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Cpath d='M9.4,12.3l10.4,10.4l10.4-10.4' fill='none' stroke='%23c9c9c9' stroke-width='3'/%3E%3C/svg%3E");
    background-size: 1.25em; background-repeat: no-repeat; background-position: right center;
    padding-right: 2em; cursor: pointer;
}
input:focus, textarea:focus, select:focus { border-bottom-color: var(--akzent); box-shadow: inset 0 -1px 0 0 var(--akzent); }
input[type="file"] { font: inherit; }
input[type="file"]::file-selector-button {
    font: inherit; font-weight: 700;
    background: var(--button); color: var(--button-text);
    border: 0; border-radius: 4px; padding: .6em .9em; margin-right: 1em; cursor: pointer;
    transition: background-color .2s, color .2s;
}
input[type="file"]::file-selector-button:hover { background: var(--button-hover); color: #fff; }

.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 2.5em; }
.copy-row { display: flex; gap: .8em; align-items: end; }
.copy-row input { flex: 1; }

/* Backend: Eingabefelder heller als der aufgehellte Hintergrund.
   Hintergrundbild = 12 % Deckkraft; in den Feldern scheint es nur noch mit 7 % durch
   (5 Prozentpunkte heller). Weiss-Anteil = 1 − 7/12 ≈ 0.42 – hier anpassbar. */
body.backend { --feld-hell: rgba(255, 255, 255, .42); }
body.backend input[type="text"], body.backend input[type="password"], body.backend input[type="email"],
body.backend textarea, body.backend select, body.backend .datei-zeile {
    background-color: var(--feld-hell);
    padding-left: .6em; padding-right: .6em;
}
body.backend select { padding-right: 2.2em; background-position: right .6em center; }

/* ---------- E-Mail-Entwurf ---------- */
.mail-aktionen { display: flex; flex-wrap: wrap; align-items: center; gap: .8em; margin: 1.2em 0 .8em; }
.mail-aktionen .button.primary { font-size: 1.05em; }
.mailtext { font-family: var(--schrift) !important; font-size: .95em !important; color: var(--text); white-space: pre-wrap; }
.mail-entwurf { margin-top: 1.2em; }
.mail-entwurf .form-group { margin-bottom: 1.2em; }

/* ---------- Mehrere Dateifelder ---------- */
.datei-liste { display: flex; flex-direction: column; gap: .6em; margin-bottom: .8em; }
.datei-zeile { display: flex; align-items: center; gap: .8em; padding-bottom: .6em; border-bottom: solid 1px rgba(88, 88, 88, .15); }
.datei-zeile input[type="file"] { flex: 1; min-width: 0; }
.datei-weg { font-size: 1.2em !important; line-height: 1 !important; min-width: 2.2em; }
#datei-plus:disabled { opacity: .4; cursor: not-allowed; background: var(--button); color: var(--button-text) !important; }
.datei-info { margin: .6em 0 0; color: var(--text-hell); }
.datei-info.zu-viele { color: var(--logo-rot); font-weight: 700; }

/* ---------- Buttons (identisch tohosis.ch) ---------- */
.button, button {
    appearance: none;
    display: inline-block;
    min-height: 2.7em; line-height: 1.3;
    padding: .86em .94em;
    border: 0; border-radius: 4px;
    background: var(--button);
    color: var(--button-text) !important;
    cursor: pointer;
    font-family: inherit;
    font-size: 1.05em; font-weight: 700;
    letter-spacing: .01em;
    text-align: center; white-space: nowrap;
    transition: background-color .2s, color .2s;
}
.button:hover, button:hover, .button:focus-visible, button:focus-visible {
    background: var(--button-hover); color: #fff !important;
}
.button.primary, button.primary { padding-left: 1.6em; padding-right: 1.6em; }
.abruf .button.primary { font-size: 1.4em; }
.button.small, button.small { font-size: .95em; min-height: 2.3em; padding: .5em .8em; }
.button.fit { width: 100%; }

/* ---------- Meldungen ---------- */
.notice { padding: .9em 1.2em; border-radius: 4px; font-weight: 400; background: rgba(255, 255, 255, .55); border-left: 4px solid; }
.notice-error { border-left-color: var(--logo-rot); color: var(--button-text); }
.notice-warn  { border-left-color: var(--s1); background: rgba(242, 132, 158, .15); }
.notice-ok    { border-left-color: var(--s3); background: rgba(123, 208, 193, .2); }

.secret-box {
    position: relative;
    background: rgba(255, 255, 255, .7);
    border-left: 4px solid var(--logo-rot);
    border-radius: 4px;
    padding: 1.2em 1.5em;
    margin: 2em 0;
    word-break: break-all;
    box-shadow: 0 1px 3px rgba(57, 69, 75, .08);
}
.secret-box pre {
    margin: 0; padding-right: 7em; white-space: pre-wrap;
    font-family: ui-monospace, Menlo, Consolas, monospace; color: var(--logo);
}
.secret-box > .copy { position: absolute; top: .8em; right: .8em; }
.secret-box p { margin: 0 0 .6em; word-break: normal; overflow-wrap: anywhere; }

/* ---------- Dateiliste ---------- */
.files { list-style: none; padding: 0; margin: 0; }
.files li {
    display: flex; align-items: center; justify-content: space-between; gap: 1em;
    padding: .7em 0; border-bottom: solid 1px rgba(88, 88, 88, .15);
}
.files li:first-child { border-top: solid 1px rgba(88, 88, 88, .15); }
.files li .button { font-size: .8em; }
.files .fname { word-break: break-all; }
.files li.done .fname::after { content: "  ✓"; color: var(--akzent); font-weight: 900; }

/* ---------- Tabelle (Backend) ---------- */
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-weight: 700; padding: 0 .75em .6em; border-bottom: solid 2px rgba(88, 88, 88, .25); }
td { padding: .7em .75em; border-bottom: solid 1px rgba(88, 88, 88, .15); vertical-align: middle; }
tbody tr:hover { background: rgba(255, 255, 255, .6); }
td form { margin: 0; }
.copy-input { min-width: 14em; font-size: .85em !important; padding: .3em 0 !important; }

.badge { display: inline-block; padding: 0 .6em; border-radius: 4px; font-size: .8em; font-weight: 700; line-height: 1.8em; }
.badge-active  { background: rgba(123, 208, 193, .3); color: #2c6d61; }
.badge-used    { background: rgba(242, 132, 158, .2); color: var(--button-text); }
.badge-expired { background: rgba(88, 88, 88, .12); color: var(--text); }

/* ---------- Footer (wie tohosis.ch) ---------- */
.site-footer {
    background: rgba(57, 69, 75, .3);
    color: var(--footer-text);
    padding: 3em 0 2.5em;
}
.site-footer .logo-fuss {
    display: inline-flex; flex-direction: column;
    color: var(--logo); border: 0;
    font-size: 38px; font-weight: 900; line-height: 1; letter-spacing: -1.9px;
}
.site-footer .logo-fuss:hover { color: var(--logo) !important; }
.site-footer .logo-fuss .rot { color: var(--logo-rot); }
.site-footer .logo-fuss .zusatz { font-weight: normal; font-size: .45em; letter-spacing: -.5px; margin-top: -.15em; padding-left: .12em; }
.site-footer .copyright { margin: 1.5em 0 0; font-size: .85em; color: rgba(58, 18, 18, .8); }

/* ---------- Responsive ---------- */
@media (max-width: 736px) {
    .logo { font-size: 44px; letter-spacing: -2px; }
    h1 { font-size: 1.85em; }
    .inner { padding: 0 1.25em; }
    .grid { grid-template-columns: 1fr; }
    :root { --grundschrift: 1.2em; }
}
@media (max-width: 380px) { .logo { font-size: 38px; } }
@media (prefers-reduced-motion: reduce) {
    body::before { animation: none; }
}
