/* storage-service Frontend – schlicht, dunkelfreundlich, mobiltauglich. */

:root {
  --bg: #0f1420;
  --bg-2: #161d2e;
  --card: #1b2438;
  --line: #2a3652;
  --text: #e8ecf5;
  --muted: #93a0bb;
  --accent: #4f8cff;
  --accent-2: #3a6fd8;
  --danger: #e5484d;
  --radius: 10px;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

main.view { max-width: 980px; margin: 0 auto; padding: 1.5rem; }

h1 { font-size: 2rem; margin: 0 0 .25rem; }
h2 { font-size: 1.35rem; margin: 1.25rem 0 .75rem; }
h3 { font-size: 1.05rem; margin: 1rem 0 .5rem; }

.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .85em; }
.empty { color: var(--muted); font-style: italic; }
.hint { color: var(--muted); font-size: .85rem; margin: .25rem 0 .75rem; }
.error { color: var(--danger); font-size: .9rem; }
.spacer { flex: 1; }

.hero { text-align: center; margin-top: 8vh; }
.hero .sub { color: var(--muted); margin-bottom: 1.5rem; }

.actions { margin-bottom: 2rem; }

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  text-align: left;
}
.card.login {
  max-width: 380px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: .35rem;
}

.row { display: flex; align-items: center; gap: .5rem; }
.row.wrap { flex-wrap: wrap; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}

.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1rem;
}
.brand { font-weight: 700; letter-spacing: .02em; }

/* Buttons */
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--bg-2);
  color: var(--text);
  border-radius: 8px;
  padding: .5rem .9rem;
  font: inherit;
  cursor: pointer;
  transition: background .15s, border-color .15s;
}
.btn:hover { background: #202a42; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-2); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.danger:hover { filter: brightness(.92); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--bg-2); }
.btn:disabled { opacity: .6; cursor: wait; }

/* Formulare */
label { display: block; margin: .5rem 0 .15rem; }
input[type="text"], input[type="password"], input[type="number"], input[type="date"] {
  width: 100%;
  background: var(--bg-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: 8px;
  padding: .55rem .7rem;
  font: inherit;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: .75rem 0 0;
}
legend { padding: 0 .4rem; color: var(--muted); }
label.check { display: flex; gap: .5rem; align-items: center; margin: .35rem 0; }

/* Dialoge */
dialog {
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0;
  max-width: min(92vw, 480px);
  width: 100%;
}
dialog.wide { max-width: min(94vw, 680px); }
dialog::backdrop { background: rgba(4, 8, 18, .65); }
.modal { padding: 1.25rem 1.4rem; display: flex; flex-direction: column; }
.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: .5rem;
  margin-top: 1rem;
}
.choice { display: flex; gap: .75rem; margin-top: 1rem; flex-wrap: wrap; }
.card-btn { flex: 1; padding: 1.25rem .75rem; font-weight: 600; min-width: 180px; }

.facts { margin: 0 0 1rem; }
.fact { display: flex; gap: .75rem; border-bottom: 1px dashed var(--line); padding: .3rem 0; }
.fact dt { width: 11rem; color: var(--muted); flex-shrink: 0; }
.fact dd { margin: 0; word-break: break-all; }

/* Quota-Balken */
.bar { height: 6px; background: var(--bg-2); border-radius: 3px; overflow: hidden; margin: .5rem 0 .75rem; }
.bar-fill { height: 100%; background: var(--accent); }

/* Key-Tabelle */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th, td { text-align: left; padding: .45rem .5rem; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; }

.key-display {
  display: block;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .75rem;
  font-family: var(--mono);
  font-size: .85rem;
  word-break: break-all;
  margin-bottom: .5rem;
  user-select: all;
}

#toast {
  position: fixed;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: .6rem 1rem;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .4);
  z-index: 50;
}

.content { padding-bottom: 3rem; }

@media (max-width: 560px) {
  .row.wrap .btn { flex: 1 1 auto; }
  .fact dt { width: 8rem; }
}
