/* Secrets Receiver — Style inspiré d'Hemmelig
   Palette: canvas #101317, surface #14181d, border #2a3038
   Text: #e6e8ea / #c4cad1 / #8b929b, accent #5fd99c
   Fonts: IBM Plex Sans (body), JetBrains Mono (code/labels) */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap');

:root {
  --canvas: #101317;
  --surface: #14181d;
  --surface-2: #181d23;
  --border: #2a3038;
  --border-soft: #22272e;
  --fg: #e6e8ea;
  --fg-2: #c4cad1;
  --muted: #8b929b;
  --accent: #5fd99c;
  --accent-12: rgba(95, 217, 156, 0.12);
  --accent-20: rgba(95, 217, 156, 0.20);
  --danger: #f0616d;
  --danger-12: rgba(240, 97, 109, 0.12);
  --radius: 6px;
  --radius-sm: 4px;
  --max-w: 640px;
}

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

body {
  font-family: 'IBM Plex Sans', system-ui, sans-serif;
  background: var(--canvas);
  color: var(--fg);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ─── Layout ─── */
.container {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 24px;
}

.header {
  border-bottom: 1px solid var(--border-soft);
  padding: 16px 0;
}

.header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  font-family: 'JetBrains Mono', monospace;
  font-weight: 500;
  font-size: 15px;
  color: var(--fg);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo-icon {
  width: 20px; height: 20px;
  color: var(--accent);
}

.header-meta {
  font-size: 13px;
  color: var(--muted);
}

main { padding: 48px 0 80px; }

/* ─── Typography ─── */
h1 {
  font-size: clamp(28px, 4.4vw, 40px);
  font-weight: 500;
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

h2 {
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 8px;
}

.subtitle {
  color: var(--muted);
  font-size: 15px;
  max-width: 480px;
  margin-bottom: 32px;
}

.label-mono {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent);
  margin-bottom: 24px;
}

/* ─── Cards ─── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
}

.card-tight { padding: 14px 18px; }

/* ─── Forms ─── */
.form-group { margin-bottom: 16px; }
.form-group:last-child { margin-bottom: 0; }

label {
  display: block;
  font-size: 13px;
  color: var(--fg-2);
  margin-bottom: 6px;
  font-weight: 500;
}

input[type="text"],
input[type="password"],
textarea,
select {
  width: 100%;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg);
  font-family: inherit;
  font-size: 14px;
  padding: 10px 12px;
  transition: border-color 0.15s;
}

input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

textarea {
  resize: vertical;
  min-height: 120px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  line-height: 1.5;
}

select {
  appearance: none;
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b929b' stroke-width='2'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--canvas);
  border-color: var(--accent);
}
.btn-primary:hover { filter: brightness(1.1); }
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-secondary {
  background: transparent;
  color: var(--fg-2);
  border-color: var(--border);
}
.btn-secondary:hover {
  border-color: var(--muted);
  color: var(--fg);
}

.btn-ghost {
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 6px 10px;
  font-size: 13px;
}
.btn-ghost:hover { color: var(--fg); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger-12);
}
.btn-danger:hover { background: var(--danger-12); }

.btn-sm { padding: 6px 14px; font-size: 13px; }

.btn-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

/* ─── Badge / State ─── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 20px;
  font-family: 'JetBrains Mono', monospace;
}

.badge-awaiting { background: var(--border-soft); color: var(--muted); }
.badge-provided { background: var(--accent-12); color: var(--accent); }
.badge-collected { background: var(--border-soft); color: var(--muted); }
.badge-expired { background: var(--danger-12); color: var(--danger); }

.badge-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
}

/* ─── Request list items ─── */
.request-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.request-info { flex: 1; min-width: 0; }

.request-label {
  font-size: 14px;
  color: var(--fg);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.request-meta {
  font-size: 12px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

.request-actions {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

/* ─── Link box (copyable) ─── */
.link-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--accent);
  word-break: break-all;
}

.link-box input {
  flex: 1;
  border: none;
  background: none;
  color: var(--accent);
  font-family: inherit;
  font-size: inherit;
  outline: none;
}

/* ─── Secret display ─── */
.secret-display {
  background: var(--canvas);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  color: var(--accent);
  word-break: break-all;
  white-space: pre-wrap;
  max-height: 400px;
  overflow-y: auto;
  position: relative;
}

/* ─── Empty state ─── */
.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--muted);
}

.empty-state svg {
  width: 48px; height: 48px;
  margin-bottom: 16px;
  opacity: 0.3;
}

/* ─── Toast ─── */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 10px 20px;
  font-size: 14px;
  color: var(--fg);
  opacity: 0;
  transition: all 0.3s;
  z-index: 1000;
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

.toast-success { border-color: var(--accent); }
.toast-error { border-color: var(--danger); }

/* ─── Spinner ─── */
.spinner {
  width: 16px; height: 16px;
  border: 2px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 24px;
}

.modal-overlay.show { display: flex; }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  width: 100%;
  max-width: 480px;
}

.modal h2 { margin-bottom: 20px; }

/* ─── Confirm page ─── */
.confirm-icon {
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--accent-12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.confirm-icon svg { width: 28px; height: 28px; color: var(--accent); }

/* ─── Utility ─── */
.text-muted { color: var(--muted); }
.text-accent { color: var(--accent); }
.text-mono { font-family: 'JetBrains Mono', monospace; }
.text-sm { font-size: 13px; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-4 { margin-top: 16px; }
.mb-0 { margin-bottom: 0; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.hidden { display: none !important; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }

/* ─── Security notice (submit page) ─── */
.security-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  background: var(--accent-12);
  border-radius: var(--radius-sm);
  color: var(--accent);
  font-size: 13px;
  margin-top: 12px;
}

/* ─── Trust badges (submit page) ─── */
.trust-badges {
  display: flex;
  gap: 16px;
  margin-top: 24px;
  flex-wrap: wrap;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--muted);
  font-family: 'JetBrains Mono', monospace;
}

.trust-badge svg { color: var(--muted); }