
:root {
  --paper:    #F4F1EA;
  --paper-2:  #EEEAE0;
  --ink:      #14120F;
  --ink-2:    #57534B;
  --ink-3:    #7B766D;
  --red:      #E23C1B;
  --on-red:   #F7F5F0;
  --rule:     rgba(20,18,15,0.18);
  --rule-2:   rgba(20,18,15,0.42);
  --field:    #FFFFFF;
  --col:      840px;
  --mono:     ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper:    #131210;
    --paper-2:  #1B1916;
    --ink:      #F2EEE5;
    --ink-2:    #A9A49A;
    --ink-3:    #8B867D;
    --red:      #FF5A32;
    --on-red:   #131210;
    --rule:     rgba(242,238,229,0.18);
    --rule-2:   rgba(242,238,229,0.44);
    --field:    #0D0C0B;
  }
}

/* ==========================================================================
   1 = Grundlage
   ========================================================================== */

* { box-sizing: border-box; }

body {
  color: var(--ink);
  background: var(--paper);
  font-family: "Helvetica Neue", Helvetica, Inter, -apple-system, system-ui, "Segoe UI", Arial, sans-serif;
  margin: 0;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

#content {
  padding: clamp(20px, 5vw, 48px);
  max-width: calc(var(--col) + 2 * clamp(20px, 5vw, 48px));
  margin: 0 auto;
}

/* Wortmarke statt Jirafeau-Logo: der Titel steht im h1 als Text und wird
   im Original per text-indent weggeschoben - hier holen wir ihn zurueck. */
h1 {
  margin: 0 0 clamp(22px, 3.5vw, 36px);
  padding-bottom: clamp(18px, 2.5vw, 26px);
  border-bottom: 1px solid var(--rule);
}

h1 a {
  display: block;
  background: none;
  text-indent: 0;
  width: auto;
  height: auto;
  margin: 0;
  left: 0;
  position: static;
  color: var(--ink);
  text-decoration: none;
  font-size: clamp(26px, 4.6vw, 44px);
  font-weight: 700;
  letter-spacing: -0.035em;
  line-height: 1.05;
}

h1 a:hover { color: var(--red); }

h2 {
  text-align: left;
  color: var(--ink);
  font-size: clamp(17px, 2.2vw, 22px);
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 1em;
}

a { color: var(--red); }

.inner { margin-top: clamp(18px, 2.5vw, 28px); }

/* ==========================================================================
   2 = Flaechen (fieldset dient hier als Karte)
   ========================================================================== */

fieldset {
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--paper-2);
  padding: clamp(18px, 2.6vw, 30px);
  margin: 0;
  width: 100%;
  max-width: none;
  min-width: 0;
  min-height: 0;
  position: relative;
}

legend {
  padding: 0;
  margin-bottom: 0.6em;
  background: none;
  color: var(--ink-3);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  display: block;
  min-width: 0;
  max-width: 100%;
  text-align: left;
  overflow-wrap: anywhere;
}

/* ==========================================================================
   3 = Bedienelemente
   ========================================================================== */

input[type="submit"] {
  background: var(--red);
  border: 0;
  border-radius: 0;
  border-bottom: 0;
  padding: 0.95em 2.2em;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--on-red);
  cursor: pointer;
  margin: 0;
  transition: background 0.15s ease, color 0.15s ease;
}

input[type="submit"]:hover,
input[type="submit"]:focus {
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-bottom: 0;
  margin: 0;
  position: static;
}

select,
input[type="text"],
input[type="password"] {
  border: 1px solid var(--rule);
  border-radius: 0;
  background: var(--field);
  color: var(--ink);
  padding: 0.65em 0.75em;
  font-family: inherit;
  font-size: 15px;
  width: 100%;
  max-width: 100%;
}

select:focus,
input[type="text"]:focus,
input[type="password"]:focus {
  outline: 2px solid var(--red);
  outline-offset: -2px;
  border-color: var(--red);
}

label { color: var(--ink-2); font-size: 14px; }

input[type="checkbox"] {
  accent-color: var(--red);
  width: 17px;
  height: 17px;
  margin: 0;
  vertical-align: middle;
}

/* Login- und Logout-Formulare (Adminbereich) */
.form.login fieldset,
.form.logout { margin-top: 1.5em; }
.form.login p { margin: 0 0 0.8em; }

/* ==========================================================================
   4 = Upload-Flaeche
   ========================================================================== */

#upload fieldset {
  border: 1px dashed var(--rule-2);
  background-color: var(--paper-2);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 64 64' fill='none' stroke='%23E23C1B' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M32 44V16'/%3E%3Cpath d='M20 28l12-12 12 12'/%3E%3Cpath d='M12 48h40'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center 42%;
  transition: border-color 0.2s ease, background-color 0.2s ease;
  min-height: 16em;
}

@media (prefers-color-scheme: dark) {
  #upload fieldset {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 64 64' fill='none' stroke='%23FF5A32' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M32 44V16'/%3E%3Cpath d='M20 28l12-12 12 12'/%3E%3Cpath d='M12 48h40'/%3E%3C/svg%3E");
  }
}

#upload fieldset:hover { border-color: var(--red); }

#upload > form { text-align: left; }
#upload p { margin: 0; }

#file_select {
  position: relative;
  width: 100%;
  height: 15em;
  cursor: pointer;
  opacity: 0;
}

#file_select::file-selector-button {
  background: var(--ink);
  color: var(--paper);
  border: 0;
  border-radius: 0;
  padding: 0.65em 1.3em;
  margin-right: 14px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  cursor: pointer;
}

#file_select::file-selector-button:hover { background: var(--red); color: var(--on-red); }

#upload.file-selected #file_select {
  opacity: 1;
  height: auto;
  padding: 0.6em 0;
}

#upload.file-selected fieldset {
  background-image: none;
  border-style: solid;
  border-color: var(--rule);
  min-height: 0;
}

/* Hinweiszeile unter dem Feld ("Maximale Dateigroesse ...") */
p.config {
  color: var(--ink-3);
  font-size: 12px;
  margin: 0.4em 0 0 !important;
}

/* ==========================================================================
   5 = Optionen (Ablaufdatum, Passwort, Einmal-Download)
   ========================================================================== */

/* Jirafeau schreibt die Hinweise und den Absendeknopf INNERHALB der Tabelle,
   aber ausserhalb jeder Zeile. Browser ziehen solche Elemente vor die Tabelle -
   deshalb stand "Abschicken" mitten in den Optionen. Flexbox plus order
   stellt die logische Reihenfolge wieder her, ohne den Upstream anzufassen. */
#options {
  color: var(--ink);
  position: relative;
  z-index: 10;
  width: 100%;
  height: auto;
  text-align: left;
  margin-top: 1.2em;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

#options > p.config { order: 1; }
#option_table { order: 2; width: 100%; border-collapse: collapse; margin-top: 1.2em; }
#options > p:not(.config) { order: 3; }

/* Absendeknopf abgesetzt ans Ende */
#options > p:not(.config) {
  margin-top: 1.6em;
  padding-top: 1.4em;
  border-top: 1px solid var(--rule);
}

#options tr { height: auto; }
#option_table tr:first-child { width: auto; height: auto; }

#options td {
  padding: 0.45em 0.9em 0.45em 0;
  vertical-align: middle;
  border: 0;
}

#options td:first-child {
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
  width: 1%;
}

#options input[type="submit"] {
  position: relative;
  margin: 1.5em 0 0;
  display: inline-block;
}

table a { color: var(--red); }
table a:hover, table a:focus { text-decoration: none; }

/* Auge zum Passwort-Einblenden - nur der Knopf im Optionsfeld, nicht der
   gleichnamige Container in der Ergebnisliste. */
/* Die Optionszelle hat rechts Innenabstand - ohne diese Ausnahme sitzt das
   Auge in diesem Abstand, also neben dem Feld statt darin. */
#options td.passwordcolumn { padding-right: 0; }

.passwordcolumn input[type="password"],
.passwordcolumn input[type="text"] { padding-right: 2.8em; }

button#show_password {
  flex: 0 0 auto;
  position: absolute;
  right: 0.7em;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.45;
  color: var(--ink);
  padding: 0;
  line-height: 0;
}

button#show_password:hover { opacity: 1; }

.passwordcolumn {
  display: flex;
  position: relative;
  align-items: center;
  width: 100%;
}

/* ==========================================================================
   6 = Ergebnis nach dem Upload
   ========================================================================== */

#uploading {
  border: 1px solid var(--rule);
  background: var(--paper-2);
  padding: clamp(18px, 2.6vw, 30px);
}

#uploaded_percentage {
  font-size: clamp(38px, 8vw, 72px);
  font-weight: 700;
  letter-spacing: -0.05em;
  color: var(--red);
  line-height: 1;
  display: block;
}

#uploaded_speed, #uploaded_time { color: var(--ink-3); font-size: 13px; }

/* Die Box selbst ist die Karte, die einzelnen Bloecke darin sind Zeilen. */
#upload_finished {
  border: 1px solid var(--rule);
  background: var(--paper-2);
  padding: 0;
  text-align: left;
}

/* Statuszeile ganz oben */
#upload_finished > p:first-child {
  color: var(--red);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  font-size: 12px;
  margin: 0;
  padding: clamp(16px, 2.2vw, 22px) clamp(18px, 2.6vw, 26px);
  border-bottom: 1px solid var(--rule);
}

#upload_finished > div {
  padding: clamp(14px, 2vw, 18px) clamp(18px, 2.6vw, 26px);
  border-bottom: 1px solid var(--rule);
}

#upload_finished > div:last-child { border-bottom: 0; }

/* Zeile 1 im Block: die Bezeichnung des Links */
#upload_finished > div > p:first-child {
  margin: 0 0 0.5em;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--ink-3);
}

#upload_finished > div > p:first-child a {
  color: var(--ink-3);
  text-decoration: none;
  border-bottom: 1px solid var(--rule-2);
}

#upload_finished > div > p:first-child a:hover { color: var(--red); border-color: var(--red); }

/* Zeile 2 im Block: die Adresse plus Kopierknopf */
#upload_finished > div > p:last-child {
  margin: 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

#upload_finished code,
#download_password input {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  background: var(--field);
  border: 1px solid var(--rule);
  padding: 0.55em 0.7em;
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

/* Kopierknopf: Emoji raus, sauberes Symbol rein */
#upload_finished button,
#download_password button {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 0;
  cursor: pointer;
  border: 1px solid var(--rule);
  background-color: transparent;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%2357534B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='11' height='11'/%3E%3Cpath d='M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

@media (prefers-color-scheme: dark) {
  #upload_finished button,
  #download_password button {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%23A9A49A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='9' width='11' height='11'/%3E%3Cpath d='M5 15H4a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v1'/%3E%3C/svg%3E");
  }
}

#upload_finished button:hover,
#download_password button:hover { border-color: var(--red); }

/* Das Mail-Symbol ist ein <img> ohne src - ohne feste Groesse bleibt davon
   nur ein Rest sichtbar. */
#upload_link_email {
  display: inline-flex;
  line-height: 0;
  border: 0 !important;
}

#upload_image_email {
  display: inline-block;
  width: 17px;
  height: 17px;
  padding: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%2357534B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16'/%3E%3Cpath d='M2 6l10 7 10-7'/%3E%3C/svg%3E") no-repeat center;
  background-size: contain;
  vertical-align: middle;
}

@media (prefers-color-scheme: dark) {
  #upload_image_email {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='17' height='17' viewBox='0 0 24 24' fill='none' stroke='%23A9A49A' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='2' y='4' width='20' height='16'/%3E%3Cpath d='M2 6l10 7 10-7'/%3E%3C/svg%3E");
  }
}

#upload_link_email:hover #upload_image_email { filter: none; opacity: 0.7; }

/* Gueltigkeitsdatum: gleiche Optik wie die Linkbloecke */
#upload_validity > p:first-child {
  margin: 0 0 0.3em;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--ink-3);
}

#upload_validity > p:last-child {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
}

/* Passwortblock in der Ergebnisliste (nicht der Auge-Knopf oben) */
div#show_password { position: static; opacity: 1; }
div#show_password > p:first-child {
  margin: 0 0 0.5em;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--ink-3);
}
#download_password p { margin: 0; display: flex; align-items: center; gap: 10px; }

.message, .info, .error { text-align: left; padding-left: 0; }
.message, .error { color: var(--red); font-style: normal; font-weight: 700; }
.info { color: var(--ink-2); }

/* ==========================================================================
   7 = Nutzungsbedingungen
   ========================================================================== */

textarea[readonly="readonly"] {
  border: 1px solid var(--rule);
  color: var(--ink);
  font-family: inherit;
  background: var(--field);
  margin: 0;
  display: block;
  padding: 1em;
  width: 100%;
}

textarea[readonly="readonly"] + p,
textarea[readonly="readonly"] + p + p { text-align: left; color: var(--ink-2); }

textarea[readonly="readonly"] + p a,
textarea[readonly="readonly"] + p + p a { font-weight: 700; text-decoration: none; color: var(--red); }

/* ==========================================================================
   8 = Admin
   ========================================================================== */

#admin fieldset,
#admin + fieldset,
#install fieldset,
#install + fieldset {
  width: 100%;
  max-width: none;
  border: 1px solid var(--rule);
  margin-bottom: 1.5em;
}

#admin table,
#admin + fieldset table,
#install table,
#install + fieldset table {
  width: 100%;
  border-collapse: collapse;
  border-bottom: 0;
}

#admin td,
#admin + fieldset td,
#install td,
#install + fieldset td {
  padding: 0.55em 0.8em 0.55em 0;
  border: 0;
  border-bottom: 1px solid var(--rule);
  vertical-align: middle;
  font-size: 14px;
}

#admin td:empty { width: auto; }

#admin table form:nth-child(odd),
#admin + fieldset tr:nth-child(odd),
#install table form:nth-child(odd),
#install + fieldset tr:nth-child(odd) { background: transparent; }

#admin fieldset > form, #install fieldset > form { margin-top: 1.5em; text-align: left; }
#admin form, #install form { display: table; width: 100%; }
#admin td:last-child, #install td:last-child { text-align: left; }
#admin .info, #install .info { width: auto; }
#admin input[type="submit"], #install input[type="submit"] { min-width: 0; padding: 0.7em 1.4em; }
#admin + fieldset table, #install + fieldset table { font-size: 0.9em; }

#admin + fieldset td:first-child input[type="submit"],
#install + fieldset td:first-child input[type="submit"] {
  background: none;
  padding: 0;
  color: var(--red);
  font-weight: 700;
  border-bottom: 0;
  min-width: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 14px;
}

#admin + fieldset td:first-child input[type="submit"]:hover,
#install + fieldset td:first-child input[type="submit"]:hover {
  background: none;
  color: var(--ink);
  text-decoration: underline;
}

/* ==========================================================================
   9 = Download-Seite
   ========================================================================== */

#self_destruct {
  font-weight: 700;
  color: var(--red);
  background: none;
  border-left: 3px solid var(--red);
  padding: 0.6em 0 0.6em 0.9em;
  margin: 1em 0;
}

/* ==========================================================================
   10 = Fusszeile
   ========================================================================== */

#copyright {
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.13em;
  color: var(--ink-3);
  margin: clamp(32px, 5vw, 56px) 0 0;
  padding-top: clamp(18px, 2.5vw, 24px);
  border-top: 1px solid var(--rule);
}

#copyright p { margin: 0; }
#copyright a { color: var(--ink-3); text-decoration: none; border-bottom: 1px solid var(--rule); }
#copyright a:hover, #copyright a:focus { color: var(--red); border-color: var(--red); }
#copyright abbr { text-decoration: none; }
#copyright span { opacity: 0.4; margin: 0 0.2em; }

/* ==========================================================================
   11 = Schmale Bildschirme
   ========================================================================== */

@media (max-width: 640px) {
  #options td { display: block; width: 100%; padding: 0.2em 0; }
  #options td:first-child { padding-top: 0.7em; }
  #options input[type="submit"] { width: 100%; }
  #upload_finished > div > p:last-child { flex-wrap: wrap; }
  #upload_finished code { width: 100%; flex-basis: 100%; }
}
