/* geoVAL Datei-Upload
   Farben und Typografie folgen geoval.de. */

:root {
  --page: #f4f4f4;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --surface-3: #eeeeee;
  --ink: #333333;
  --heading: #334d55;
  --logo-slate: #485f71;
  --blue: #006699;
  --blue-dark: #004d73;
  --blue-soft: #eaf4fa;
  --line: #cccccc;
  --line-soft: #e2e2e2;
  --muted: #666666;
  --muted-light: #999999;
  --orange: #ffb040;
  --orange-light: #ffe0b0;
  --orange-dark: #e8891c;
  --error: #a10000;
  --success: #2e6b30;
  --font: Verdana, Arial, Helvetica, sans-serif;
  --mono: "Courier New", Courier, monospace;
}

/* ---------------------------------------------------------------- Grundlagen */

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--page);
  color: var(--ink);
  font: 14px/1.5 var(--font);
}

::selection {
  background: var(--blue-soft);
  color: var(--ink);
}

h1,
h2,
p {
  margin-top: 0;
}

button,
input,
textarea {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

code {
  padding: 0 2px;
  background: var(--surface-3);
  color: var(--ink);
  font: 12px var(--mono);
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------- Rahmen */

.shell {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 24px;
}

.site-header {
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.brand {
  display: inline-block;
  max-width: 100%;
}

.brand img {
  display: block;
  width: 796px;
  max-width: 100%;
  height: auto;
  border: 0;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  padding: 5px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-3);
  font-size: 12px;
  line-height: 1.7;
}

.site-nav a {
  padding: 1px 7px;
  color: var(--blue);
  text-decoration: none;
}

.site-nav a:first-child {
  padding-left: 0;
}

.site-nav a:hover {
  text-decoration: underline;
}

.site-nav .nav-brand {
  color: var(--heading);
  font-weight: bold;
}

.content {
  margin-top: 20px;
}

.page-heading {
  margin-bottom: 14px;
}

.page-heading h1 {
  margin: 0 0 6px;
  color: var(--heading);
  font-size: 22px;
  font-weight: bold;
  line-height: 1.25;
}

.page-heading p {
  max-width: 72ch;
  margin: 0;
  color: var(--ink);
  line-height: 1.5;
}

/* -------------------------------------------------------------------- Formular */

.upload-form {
  border: 1px solid var(--line);
  border-top: 3px solid var(--orange);
  background: var(--surface);
}

.panel {
  padding: 18px 20px;
  border-bottom: 1px solid var(--line-soft);
}

.panel:last-of-type {
  border-bottom: 0;
}

.panel h2 {
  margin: 0 0 3px;
  color: var(--blue);
  font-size: 16px;
  font-weight: bold;
  line-height: 1.3;
}

.hint {
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.field-label {
  display: block;
  margin-bottom: 4px;
  color: var(--heading);
  font-size: 12px;
  font-weight: bold;
}

.field-hint {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11.5px;
}

.optional,
.unit {
  color: var(--muted);
  font-weight: normal;
}

input[type="text"],
input[type="number"],
textarea {
  width: 100%;
  padding: 6px 8px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  color: var(--ink);
  font: 13px/1.4 var(--font);
}

input[type="text"]:focus,
input[type="number"]:focus,
textarea:focus {
  border-color: var(--blue);
  outline: none;
  box-shadow: 0 0 0 2px #cfe6f2;
}

input::placeholder,
textarea::placeholder {
  color: var(--muted-light);
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.mono {
  font-family: var(--mono);
  font-size: 13px;
}

/* ------------------------------------------------------------------------ Ziel */

.guid-row {
  display: grid;
  gap: 4px;
}

.guid-input-wrap {
  display: flex;
  align-items: stretch;
  gap: 8px;
}

.guid-input-wrap input {
  flex: 1 1 auto;
  min-width: 0;
}

.guid-input-wrap button {
  flex: 0 0 auto;
}

.field-state {
  min-height: 1.35em;
  margin: 0;
  color: var(--muted);
  font-size: 11.5px;
}

.field-state.valid {
  color: var(--success);
}

.field-state.invalid {
  color: var(--error);
}

/* ------------------------------------------------------------------ Metadaten */

.meta-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr);
  gap: 14px 20px;
}

.meta-side {
  display: grid;
  gap: 14px;
  align-content: start;
}

.field {
  display: block;
  min-width: 0;
}

.chunk-field input {
  max-width: 150px;
}

/* -------------------------------------------------------------------- Dateien */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: 132px;
  padding: 20px 16px;
  border: 1px dashed #999999;
  background: var(--surface-2);
  text-align: center;
}

.dropzone:hover,
.dropzone.dragover {
  border-color: var(--blue);
  background: var(--blue-soft);
}

.dropzone svg {
  width: 38px;
  height: 38px;
  margin-bottom: 3px;
  fill: none;
  stroke: var(--blue);
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.drop-title {
  margin: 0;
  color: var(--heading);
  font-size: 14px;
  font-weight: bold;
}

.dropzone .hint {
  margin: 0;
}

.file-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  margin-top: 10px;
}

.file-list {
  margin: 14px 0 0;
  padding: 0;
  border-top: 1px solid var(--line-soft);
  list-style: none;
}

.file-list:empty {
  display: none;
}

.file-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 6px 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-soft);
}

.file-row:last-child {
  border-bottom: 0;
}

.file-main {
  min-width: 0;
}

.file-name {
  display: block;
  overflow: hidden;
  color: var(--ink);
  font: 13px/1.4 var(--font);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 12px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
}

.file-status {
  color: var(--muted);
}

.file-status[data-status="uploading"],
.file-status[data-status="retrying"],
.file-status[data-status="resyncing"] {
  color: var(--blue);
}

.file-status[data-status="done"] {
  color: var(--success);
}

.file-status[data-status="error"] {
  color: var(--error);
}

.file-error {
  flex-basis: 100%;
  color: var(--error);
}

.file-error:empty {
  display: none;
}

.file-remove {
  width: 24px;
  padding: 0;
  color: var(--muted-light);
  font-size: 17px;
  line-height: 1;
}

.file-remove:hover:not(:disabled) {
  color: var(--error);
  text-decoration: none;
}

.progress {
  grid-column: 1 / -1;
  height: 8px;
  border: 1px solid #d9d9d9;
  background: var(--surface-3);
}

.progress-fill {
  width: 0;
  height: 100%;
  background: linear-gradient(90deg, var(--orange-light) 0%, var(--orange) 55%, var(--orange-dark) 100%);
  transition: width 0.12s linear;
}

/* ------------------------------------------------------------------- Aktionen */

.submit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 20px;
  border-top: 1px solid var(--line);
  background: #f5f5f5;
}

.status {
  min-height: 1.4em;
  margin: 0;
  color: var(--ink);
  font-size: 12.5px;
  line-height: 1.4;
}

.status.busy {
  color: var(--ink);
}

.status.success {
  color: var(--success);
}

.status.error {
  color: var(--error);
}

.primary,
.secondary,
.link-button {
  border-radius: 0;
  font: 13px/1.2 var(--font);
}

.primary {
  flex: 0 0 auto;
  min-width: 110px;
  padding: 8px 20px;
  border: 1px solid #005580;
  background: var(--blue);
  color: #ffffff;
  font-weight: bold;
}

.primary:hover:not(:disabled) {
  border-color: #003d5c;
  background: var(--blue-dark);
}

.primary:disabled {
  opacity: 0.45;
}

.secondary {
  padding: 6px 12px;
  border: 1px solid #999999;
  background: var(--surface);
  color: var(--ink);
}

.secondary:hover:not(:disabled) {
  border-color: var(--blue);
  background: var(--surface-3);
  color: var(--blue);
}

.secondary:disabled {
  opacity: 0.5;
}

.link-button {
  padding: 4px 2px;
  border: 0;
  background: transparent;
  color: var(--blue);
}

.link-button:hover:not(:disabled) {
  text-decoration: underline;
}

.link-button:disabled {
  color: var(--muted-light);
  text-decoration: none;
}

.form-note {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 11.5px;
  line-height: 1.45;
}

/* -------------------------------------------------------------------- Fußzeile */

.site-footer {
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--muted-light);
  font-size: 11px;
  line-height: 1.6;
}

.footer-brand {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 4px;
}

.footer-brand img {
  display: block;
  width: 100px;
  height: 29px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 5px;
}

.site-footer a {
  color: var(--blue);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.footer-links span {
  color: var(--muted-light);
}

.noscript {
  width: min(860px, calc(100% - 32px));
  margin: 0 auto 20px;
  padding: 10px 12px;
  border: 1px solid var(--error);
  background: #fbeaea;
  color: var(--error);
  font-size: 13px;
}

/* ------------------------------------------------------------------ Responsiv */

@media (max-width: 700px) {
  .meta-grid {
    grid-template-columns: 1fr;
  }

  .chunk-field input {
    max-width: none;
  }
}

@media (max-width: 560px) {
  .shell {
    width: calc(100% - 20px);
    padding-top: 12px;
  }

  .site-header {
    padding: 8px 0;
  }

  .site-nav {
    font-size: 11.5px;
  }

  .site-nav a {
    padding: 1px 5px;
  }

  .page-heading h1 {
    font-size: 20px;
  }

  .panel {
    padding: 16px;
  }

  .guid-input-wrap {
    flex-wrap: wrap;
  }

  .guid-input-wrap input {
    flex-basis: 100%;
  }

  .submit-bar {
    flex-direction: column;
    align-items: stretch;
    padding: 13px 16px;
  }

  .primary {
    width: 100%;
  }

  .footer-links {
    gap: 2px 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
