
/* ==========================================================================
   Summary

   0 = Design tokens
   1 = Basic Style
   2 = Copyright
   3 = Options
   4 = Upload
   5 = Terms of service
   6 = Install
   7 = Admin
   8 = Download page

   ========================================================================== */

/* ==========================================================================
   0 = Design tokens
   ========================================================================== */

:root {
  --gold: rgb(236, 163, 32);
  --gold-hover: rgb(241, 177, 35);
  --text: black;
  --text-body: rgb(57, 57, 57);
  --text-muted: rgb(123, 115, 105);
  --text-inverse: white;
  --surface: rgb(242, 241, 239);
  --card: rgb(255, 255, 255);
  --line: rgb(228, 225, 222);
  --line-strong: rgb(189, 174, 167);
  --font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --radius: 0px;
  --border-width: 1px;
  --border-style: solid;
  --border-colour: rgb(236, 163, 32);
  --button-padding: 12px 30px;
}

/* ==========================================================================
   1 = Basic Style
   ========================================================================== */

body {
  margin: 0;
  font-family: var(--font);
  font-weight: 300;
  line-height: 1.5;
  color: var(--text-body);
  -webkit-font-smoothing: antialiased;
  background-repeat: no-repeat;
  background-position: center center;
  background-attachment: fixed;
  background-size: cover;
}

.webp body { background-image: url(bg.webp); }
.no-webp body { background-image: url(bg.jpg); }

#content {
  padding: 2em;
}

h1 a {
  display: block;
  background: url(logo.png) no-repeat;
  background-size: 100% 100%;
  text-indent: -9999px;
  width: 194px;
  height: 40px;
  margin: 1em auto 2em;
  position: relative;
  left: 0.4em;
}

.webp h1 a { background-image: url(logo.webp); }

h2 {
  text-align: center;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-inverse);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
}

strong,
b {
  font-weight: 600;
}

a {
  color: var(--text);
  text-decoration-color: var(--gold);
  text-underline-offset: 3px;
}

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

/* Several pages wrap a <button> in a link: no underline below the button. */
a:has(> button) {
  text-decoration: none;
}

/* Cards: forms, status boxes and messages share one white panel. */
fieldset,
#upload_finished,
#uploading,
.message,
.info,
.error {
  box-sizing: border-box;
  position: relative;
  width: 36em;
  max-width: 100%;
  min-height: 15em;
  margin: 0 auto;
  padding: 2em;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text-body);
}

#upload_finished,
#uploading,
.message,
.info,
.error {
  text-align: center;
}

/* The legend is the card's title, styled like the headlines on dedon.de. */
legend {
  float: left;
  width: 100%;
  margin: 0 0 1.5em;
  padding: 0;
  font-size: 1.25em;
  font-weight: 300;
  letter-spacing: 2px;
  text-transform: uppercase;
  text-align: center;
  color: var(--text);
}

legend + * {
  clear: both;
}

fieldset > form {
  text-align: center;
}

table a {
  color: var(--text);
}

table a:hover,
table a:focus {
  text-decoration: none;
}

/* Primary button: gold fill; on hover it turns white with a gold border. */
button,
input[type="submit"] {
  display: inline-block;
  margin: 10px;
  padding: var(--button-padding);
  border: var(--border-width) var(--border-style) var(--border-colour);
  border-radius: var(--radius);
  background: var(--gold);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 300;
  line-height: 1.2;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

button:hover,
input[type="submit"]:hover {
  background: #FFF;
  border-color: var(--gold-hover);
}

/* Secondary button: outlined in black like "Add to my favorites" on dedon.de;
   on hover it fills with gold. */
button,
.logout input[type="submit"] {
  background: #FFF;
  border: 1px solid var(--text);
}

#upload_link_button,
.acceptcookies {
  background: var(--gold);
  border-color: var(--gold);
}

button:hover,
.logout input[type="submit"]:hover {
  background: var(--gold);
  border-color: var(--gold-hover);
}

#upload_link_button:hover,
.acceptcookies:hover {
  background: #FFF;
}

button:focus-visible,
input[type="submit"]:focus-visible {
  outline: 2px solid var(--text);
  outline-offset: 2px;
}

input[type="file"] {
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-body);
}

input[type="file"]::file-selector-button {
  margin-right: 1em;
  padding: 8px 20px;
  border: 1px solid var(--text);
  border-radius: var(--radius);
  background: #FFF;
  color: var(--text);
  font-family: var(--font);
  font-size: 12px;
  font-weight: 300;
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}

input[type="file"]::file-selector-button:hover {
  background: var(--gold);
  border-color: var(--gold-hover);
}

select,
input[type="text"],
input[type="password"] {
  box-sizing: border-box;
  width: 400px;
  max-width: 100%;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--text);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text-body);
  font-family: var(--font);
  font-size: 14px;
  font-weight: 300;
  letter-spacing: 1px;
}

select { width: 100%; }

select:focus,
input[type="text"]:focus,
input[type="password"]:focus {
  outline: none;
  border-bottom-color: var(--gold);
  box-shadow: inset 0 -1px 0 var(--gold);
}

::placeholder {
  color: var(--text-muted);
  opacity: 1;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--gold);
  cursor: pointer;
}

code {
  display: inline-block;
  max-width: 100%;
  padding: 4px 8px;
  background: var(--surface);
  color: var(--text-body);
  word-break: break-all;
}

.config {
  font-size: 0.85em;
  color: var(--text-muted);
}

.inner {
  margin-top: 3em;
}

#upload fieldset:has(#file_select) {
  border: 2px dashed var(--line-strong);
  background: url(upload.svg) no-repeat center 60% / 12em, var(--card);
  -webkit-transition: all 0.3s ease;
          transition: all 0.3s ease;
}

#upload fieldset:has(#file_select):hover,
#upload fieldset:has(#file_select).drag-over {
  border-color: var(--gold-hover);
  background: url(upload2.svg) no-repeat center 60% / 12em, var(--card);
}

#upload > form {
  text-align: center;
}

#upload p {
  margin: 0;
}

#upload + center,
#upload > center {
  margin-top: 1em;
}

#file_select {
  position: relative;
  width: 100%;
  height: 16em;
  cursor: pointer;
  opacity: 0;
}
  #upload.file-selected #file_select {
    opacity: 1;
    height: 2.5em;
    margin-top: 4.5em;
  }
  /* Once a file is chosen the cloud stays, smaller and above the file name. */
  #upload.file-selected fieldset:has(#file_select),
  #upload.file-selected fieldset:has(#file_select):hover {
    background-position: center 4.25em;
    background-size: 5em;
  }

#upload2 fieldset {
  -webkit-transition: all 0.3s ease;
          transition: all 0.3s ease;
}

/* Wider card for pages with a table (list of one-year tokens). */
#upload2 fieldset:has(table) {
  width: auto;
  max-width: 60em;
}

#upload2 > form {
  text-align: center;
}

#upload2 p {
  margin: 0;
}

#upload2 table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9em;
  text-align: left;
}

#upload2 th {
  padding: 10px;
  border-bottom: 1px solid var(--text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text);
}

#upload2 td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

/* ==========================================================================
   2 = Copyright
   ========================================================================== */

#copyright {
  text-align: center;
  font-size: 0.8em;
  letter-spacing: 0.5px;
  color: var(--text-inverse);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.8);
  margin: 3em auto;
}

#copyright a {
  color: var(--text-inverse);
  text-decoration: none;
}

#copyright a:hover,
#copyright a:focus {
  text-decoration: underline;
}

/* ==========================================================================
   3 = Options
   ========================================================================== */

#options {
  position: relative;
  z-index: 10;
  width: 100%;
  height: 90%;
}

#options tr { height: 3.2em; }

#option_table {
  width: 100%;
  margin: 1em auto 0;
}

#option_table tr:first-child {
  width: 100%;
  height: 100%;
}

/* Field labels, like "Furniture color" on dedon.de. */
#option_table td:first-child {
  width: 1%;
  white-space: nowrap;
  padding-right: 1.5em;
  font-size: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: left;
  color: var(--text-muted);
}

#option_table td:last-child {
  text-align: left;
}

#option_table input[type="text"] {
  width: 100%;
}

#options input[type="submit"] {
  position: relative;
  margin: 1.5em auto 0;
}

/* ==========================================================================
   4 = Upload
   ========================================================================== */

#upload_finished > p:nth-child(1) {
  margin-top: 0;
  font-size: 1.25em;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text);
}

#upload_finished div p:nth-child(1) {
  font-weight: 300;
}

#upload_finished a,
#uploading a {
  color: var(--text);
}

#uploaded_percentage {
  margin: 0.3em 0;
  font-size: 3em;
  font-weight: 300;
  letter-spacing: 2px;
  color: var(--text);
}

#uploaded_speed,
#uploaded_time {
  color: var(--text-muted);
  letter-spacing: 0.5px;
}

#upload_finished a:hover,
#uploading a:hover,
#upload_finished a:focus,
#uploading a:focus {
  text-decoration-color: var(--text);
}

.message,
.info,
.error {
  min-height: 0;
}

.message,
.error {
  color: #C0392B;
  font-weight: 400;
}

#upload_link_email {
  margin-left: 10px;
}

#upload_image_email {
  padding-left: 20px;
  padding-bottom: 15px;
  background: url(email.png) no-repeat;
}

/* ==========================================================================
   5 = Terms of service
   ========================================================================== */

textarea[readonly="readonly"] {
  border: 0;
  color: var(--text-body);
  font-family: var(--font);
  background: none;
  margin: auto;
  display: block;
}

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

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

textarea[readonly="readonly"] + p a:hover,
textarea[readonly="readonly"] + p + p a:hover,
textarea[readonly="readonly"] + p a:focus,
textarea[readonly="readonly"] + p + p a:focus {
  text-decoration: underline;
}

/* ==========================================================================
   6 = Install
   ========================================================================== */

#install fieldset,
#install + fieldset {
  width: auto;
  max-width: 50em;
}

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

#install td,
#install + fieldset td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

#install td:empty {
  width: 13.1em;
}

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

#install fieldset > form {
  margin-top: 2em;
  text-align: center;
}

#install form {
  display: table;
  width: 100%;
}

#install td:last-child { text-align: left; }

#install .info { width: 19em; }

#install input[type="submit"] {
  min-width: 10.5em;
}

#install + fieldset table {
  font-size: 0.9em;
}

#install + fieldset td:first-child input[type="submit"] {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

#install + fieldset td:first-child input[type="submit"]:hover,
#install + fieldset td:first-child input[type="submit"]:focus {
  text-decoration: underline;
}

/* ==========================================================================
   7 = Admin
   ========================================================================== */

#admin fieldset,
#admin + fieldset {
  width: auto;
  max-width: 60em;
}

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

#admin td,
#admin + fieldset td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

#admin td:empty {
  width: 13.1em;
}

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

#admin fieldset > form {
  margin-top: 2em;
  text-align: center;
}

#admin form {
  display: table;
  width: 100%;
}

#admin td:last-child { text-align: left; }

#admin .info { width: 19em; }

#admin input[type="submit"] {
  min-width: 10.5em;
}

#admin input[type="text"] {
  width: 100%;
}

#admin + fieldset table {
  font-size: 0.9em;
}

#admin + fieldset td:first-child input[type="submit"] {
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  min-width: 0;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
}

#admin + fieldset td:first-child input[type="submit"]:hover,
#admin + fieldset td:first-child input[type="submit"]:focus {
  text-decoration: underline;
}

/* ==========================================================================
   8 = Download page
   ========================================================================== */

#self_destruct {
  font-weight: 600;
  color: #C0392B;
  background: url('pixel_bomb.png') no-repeat left center / 40px 40px, var(--surface);
  padding: 10px 10px 10px 50px;
}

#download table {
  margin: 0 auto;
}

/* ==========================================================================
   Small screens
   ========================================================================== */

@media (max-width: 600px) {
  #content {
    padding: 1em;
  }

  fieldset,
  #upload_finished,
  #uploading,
  .message,
  .info,
  .error {
    padding: 1.5em 1em;
  }

  button,
  input[type="submit"] {
    margin: 6px 0;
  }
}
