/* TheFileServer – Bausteine: OTP-Eingabe, Modal, Dropzone, Token-Anzeige, aufklappbare Karten. */
/* ---------- Animierter OTP-Code-Eingabe ---------- */

.otp-card {
  animation: otp-appear 0.45s ease-out both;
}

.otp-card .hint {
  color: var(--muted);
  font-size: 13px;
  margin-top: -6px;
  margin-bottom: 6px;
}

.otp-fieldset {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin: 6px 0 16px;
}

.otp-digit {
  width: 48px;
  height: 56px;
  text-align: center;
  font-size: 24px;
  font-family: var(--mono);
  color: var(--text);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0;
  caret-color: var(--accent);
  transition: transform 0.12s, border-color 0.15s, box-shadow 0.15s, background 0.15s;
}

.otp-digit:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(74, 184, 240, 0.22), 0 0 18px rgba(74, 184, 240, 0.12);
  transform: translateY(-2px);
  background: var(--surface);
}

.otp-digit.filled {
  border-color: var(--accent-dim);
  background: rgba(74, 184, 240, 0.08);
}

.otp-submit {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.otp-shake {
  animation: otp-shake 0.42s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes otp-appear {
  from {
    opacity: 0;
    transform: translateY(16px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes otp-shake {
  10%, 90% { transform: translateX(-1px); }
  20%, 80% { transform: translateX(2px); }
  30%, 50%, 70% { transform: translateX(-4px); }
  40%, 60% { transform: translateX(4px); }
}

@media (max-width: 420px) {
  .otp-fieldset { gap: 7px; }
  .otp-digit { width: 42px; height: 50px; font-size: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  .otp-card,
  .otp-digit,
  .otp-shake {
    animation: none;
    transition: none;
  }
  .otp-digit:focus { transform: none; }
}

/* ---------- Modaler Options-Dialog ---------- */

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  width: min(380px, 90vw);
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.4);
}
.modal-card h3 { margin-bottom: 14px; font-size: 16px; }
.modal-card select { margin-bottom: 16px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }

.tool-panel {
  background: var(--surface-2);
  padding: 10px 14px !important;
}
.tool-panel .btn { margin-right: 8px; }

.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--muted);
}
.badge.green { color: var(--green); border-color: rgba(74, 240, 160, 0.4); }
.badge.red { color: var(--err); border-color: rgba(240, 96, 96, 0.4); }

/* ---------- Dropzone / Fortschritt ---------- */

.drop-zone {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 26px;
  text-align: center;
  color: var(--muted);
  transition: border-color .15s, background .15s;
  margin-bottom: 16px;
}
.drop-zone.dragover { border-color: var(--accent); background: rgba(74, 184, 240, 0.06); color: var(--text); }

.progress {
  height: 6px;
  background: var(--surface-2);
  border-radius: 4px;
  overflow: hidden;
  margin-top: 10px;
  display: none;
}
.progress .bar { height: 100%; width: 0; background: var(--accent); transition: width .2s; }

/* ---------- Token-Anzeige ---------- */

.token-box {
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 1px;
  background: var(--surface-2);
  border: 1px solid var(--accent-dim);
  border-radius: 8px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  word-break: break-all;
}

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

.section-title {
  font-family: var(--mono);
  font-size: 15px;
  color: var(--muted);
  margin: 30px 0 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 18px;
  align-items: start;
}

@media (max-width: 640px) {
  .hero h1 { font-size: 26px; }
  table.files th:nth-child(3), table.files td:nth-child(3) { display: none; }
  .topbar { padding: 12px 14px; }
  .container { padding: 20px 14px 32px; }
}

/* Aufklappbare Karten (Freigaben-Seite): zugeklappt per Vorgabe */
details.fold > summary { cursor: pointer; list-style: none; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary h2::after { content: " ▾"; font-size: 0.8em; opacity: 0.6; }
details.fold[open] > summary h2::after { content: " ▴"; }

.settings-layout { display: grid; grid-template-columns: 240px minmax(0, 520px); gap: 24px; align-items: start; }
.settings-nav { display: flex; flex-direction: column; gap: 4px; }
.settings-nav a { padding: 8px 12px; border-radius: 8px; text-decoration: none; color: inherit; }
.settings-nav a:hover { background: rgba(127,127,127,.15); }
.settings-nav a.active { background: rgba(127,127,127,.25); font-weight: 600; }
.settings-card[hidden] { display: none; }
@media (max-width: 700px) { .settings-layout { grid-template-columns: 1fr; } }
