:root {
  --bg: #0f0f13;
  --bg2: #18181f;
  --bg3: #22222c;
  --border: #2e2e3a;
  --accent: #6c63ff;
  --accent-hover: #5a52e0;
  --accent-dim: rgba(108, 99, 255, 0.15);
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --success: #4ade80;
  --error: #f87171;
  --radius: 12px;
  --font: 'Inter', system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 48px 16px 80px;
}

/* Header */
.header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 48px;
}
.logo {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text);
}
.logo span { color: var(--accent); }
.tagline {
  font-size: 13px;
  color: var(--text-muted);
  margin-left: 4px;
}

/* Card */
.card {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 560px;
  padding: 32px;
}

/* Drop zone */
.dropzone {
  border: 2px dashed var(--border);
  border-radius: 10px;
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  position: relative;
}
.dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}
.dz-icon { font-size: 40px; margin-bottom: 12px; }
.dz-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 6px;
}
.dz-sub { font-size: 13px; color: var(--text-muted); }

/* File list */
.file-list { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}
.file-icon { font-size: 20px; flex-shrink: 0; }
.file-info { flex: 1; min-width: 0; }
.file-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.file-size { font-size: 12px; color: var(--text-muted); }
.file-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s;
  flex-shrink: 0;
}
.file-remove:hover { color: var(--error); }

/* Progress bar */
.file-progress {
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  margin-top: 6px;
  overflow: hidden;
}
.file-progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.2s;
  border-radius: 2px;
}

/* Options section */
.options { margin-top: 24px; display: flex; flex-direction: column; gap: 14px; }

.field label {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 6px;
  font-weight: 500;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field textarea,
.field select {
  width: 100%;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.2s;
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  border-color: var(--accent);
}
.field textarea { resize: vertical; min-height: 80px; }
.field select { appearance: none; cursor: pointer; }

.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

/* Toggle */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
}
.toggle-label { font-size: 14px; }
.toggle-sub { font-size: 12px; color: var(--text-muted); }
.toggle {
  width: 40px;
  height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  transition: background 0.2s;
  flex-shrink: 0;
}
.toggle.on { background: var(--accent); }
.toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform 0.2s;
}
.toggle.on::after { transform: translateX(18px); }

/* Divider */
.divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 8px 0;
}

/* Button */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 24px;
  background: var(--accent);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, opacity 0.2s;
  margin-top: 24px;
}
.btn:hover:not(:disabled) { background: var(--accent-hover); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* Overall progress */
.overall-progress {
  margin-top: 20px;
  display: none;
}
.overall-progress.visible { display: block; }
.progress-label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.progress-bar-wrap {
  height: 6px;
  background: var(--border);
  border-radius: 3px;
  overflow: hidden;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
  border-radius: 3px;
}

/* Result */
.result {
  margin-top: 24px;
  padding: 20px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 10px;
  display: none;
  text-align: center;
}
.result.visible { display: block; }
.result-icon { font-size: 32px; margin-bottom: 10px; }
.result-title { font-size: 17px; font-weight: 700; margin-bottom: 8px; }
.result-sub { font-size: 13px; color: var(--text-muted); margin-bottom: 16px; }
.result-link-box {
  display: flex;
  gap: 8px;
  align-items: center;
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}
.result-link {
  flex: 1;
  font-size: 13px;
  color: var(--accent);
  word-break: break-all;
  text-align: left;
}
.copy-btn {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.copy-btn:hover { background: var(--accent-dim); }

/* Download page */
.dl-card { text-align: center; }
.dl-sender {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.dl-title { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.dl-meta { font-size: 13px; color: var(--text-muted); margin-bottom: 20px; }
.dl-message {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 20px;
  text-align: left;
}
.dl-files {
  text-align: left;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dl-file {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px 14px;
}
.dl-file-info { flex: 1; min-width: 0; }
.dl-file-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.dl-file-size { font-size: 12px; color: var(--text-muted); }
.dl-file-btn {
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 12px;
  color: var(--accent);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.dl-file-btn:hover { background: var(--accent-dim); }

/* Password prompt */
.password-section {
  margin-bottom: 20px;
  display: none;
}
.password-section.visible { display: block; }

/* Expiry badge */
.expiry-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 20px;
}

/* Alert */
.alert {
  padding: 14px 16px;
  border-radius: 8px;
  font-size: 14px;
  margin-top: 16px;
}
.alert-error { background: rgba(248, 113, 113, 0.1); border: 1px solid rgba(248, 113, 113, 0.3); color: var(--error); }
.alert-success { background: rgba(74, 222, 128, 0.1); border: 1px solid rgba(74, 222, 128, 0.3); color: var(--success); }
.alert-warning { background: rgba(251, 191, 36, 0.1); border: 1px solid rgba(251, 191, 36, 0.3); color: #b45309; }

/* Trust chain */
.cert-trust-section { margin: 24px 0; }
.cert-trust-chain { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.trust-item {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 10px 14px; border-radius: 8px; font-size: 13px;
}
.trust-item--ok      { background: rgba(74, 222, 128, 0.08); border: 1px solid rgba(74, 222, 128, 0.25); }
.trust-item--pending { background: rgba(251, 191, 36, 0.08); border: 1px solid rgba(251, 191, 36, 0.25); }
.trust-icon  { font-size: 15px; margin-top: 1px; flex-shrink: 0; }
.trust-label { font-weight: 600; color: var(--text); }
.trust-value { color: var(--muted); font-size: 12px; margin-top: 2px; }
.btn--secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn--secondary:hover { background: var(--surface); }

/* Spinner */
@keyframes spin { to { transform: rotate(360deg); } }
.spinner {
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: white;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

/* Utils */
.hidden { display: none !important; }
.mt8 { margin-top: 8px; }
.text-muted { color: var(--text-muted); font-size: 13px; }

/* Footer */
.footer {
  margin-top: auto;
  padding-top: 40px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* ── Certificate / Verify page ─────────────────────────────────────────────── */

.cert-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 12px;
}
.cert-badge--deposit  { background: rgba(108,99,255,0.2); color: var(--accent); }
.cert-badge--receipt  { background: rgba(74,222,128,0.15); color: var(--success); }

.cert-header { margin-bottom: 24px; }
.cert-title  { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.cert-subtitle { font-size: 13px; color: var(--text-muted); }

.cert-fields { display: flex; flex-direction: column; gap: 14px; margin-bottom: 24px; }
.cert-field-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em; color: var(--text-muted); margin-bottom: 3px; }
.cert-field-value  { font-size: 14px; word-break: break-all; }
.cert-mono { font-family: 'Courier New', monospace; font-size: 13px; }
.cert-hash-wrap { word-break: break-all; }

.cert-section-title {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.07em;
  color: var(--text-muted); margin-bottom: 12px; margin-top: 4px;
}

.cert-files { display: flex; flex-direction: column; gap: 10px; margin-bottom: 24px; }
.cert-file {
  background: var(--bg3); border: 1px solid var(--border);
  border-radius: 8px; padding: 12px 14px;
}
.cert-file-name { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.cert-file-meta { font-size: 12px; color: var(--text-muted); }
.cert-file-hash { font-family: 'Courier New', monospace; font-size: 11px; color: var(--text-muted); word-break: break-all; margin-top: 4px; }

.cert-verify-section { margin-bottom: 24px; }
.cert-dropzone {
  border: 1.5px dashed var(--border); border-radius: 10px;
  padding: 28px 20px; text-align: center;
  font-size: 13px; color: var(--text-muted);
  cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.cert-dropzone:hover, .cert-dropzone.drag-over {
  border-color: var(--accent); background: var(--accent-dim);
}

.cert-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 4px; }

@media (max-width: 480px) {
  .card { padding: 24px 20px; }
  .field-row { flex-direction: column; gap: 14px; }
}
