/* styles.css · biblioteca-sellos-pdf · 1000HW
 * Vanilla CSS · CSS Variables · BEM · NO Tailwind
 * Cache-bust: ?v=1
 */

/* ─── Variables ─────────────────────────────────────────── */
:root {
  --bg: #050505;
  --surface: #0a0a0a;
  --surface2: #111111;
  --border: #222222;
  --border2: #333333;
  --text: #e0e0e0;
  --muted: #888888;
  --accent: #ccff00;
  --accent-dim: rgba(204, 255, 0, 0.1);
  --danger: #ff4444;
  --success: #44ff88;
  --font-display: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;
  --radius: 8px;
  --radius-lg: 12px;
  --shadow: 0 4px 24px rgba(0,0,0,0.5);
}

/* ─── Reset ──────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

/* ─── Accessibility ──────────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 9999;
  padding: 0.75rem 1.5rem;
  background: var(--accent);
  color: var(--bg);
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius);
}
.skip-link:focus { left: 0; top: 0; }

button:focus { outline: none; }
button:focus-visible,
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

body {
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-image: radial-gradient(#111 1px, transparent 1px);
  background-size: 40px 40px;
}

::selection { background: var(--accent); color: #000; }

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border2); border-radius: 3px; }

/* ─── Offline Banner ─────────────────────────────────────── */
.offline-banner {
  background: var(--accent-dim);
  border-bottom: 1px solid var(--accent);
  color: var(--accent);
  padding: 8px 16px;
  text-align: center;
  font-size: 13px;
  font-family: var(--font-mono);
  display: none;
}
.offline-banner.show { display: block; }

/* ─── Nav ────────────────────────────────────────────────── */
.nav {
  border-bottom: 1px solid var(--border);
  padding: 14px 24px;
  background: rgba(5,5,5,0.9);
  backdrop-filter: blur(8px);
  position: sticky;
  top: 0;
  z-index: 40;
}
.nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav__back {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  text-decoration: none;
  font-size: 12px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  transition: color 0.2s;
}
.nav__back:hover { color: var(--accent); }
.nav__arrow { transition: transform 0.2s; }
.nav__back:hover .nav__arrow { transform: translateX(-3px); }
.nav__brand {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text);
}
.nav__brand span { color: var(--accent); }
.nav__lang {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--muted);
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 4px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: 0.05em;
}
.nav__lang:hover { border-color: var(--accent); color: var(--accent); }

/* ─── Main ───────────────────────────────────────────────── */
.main {
  flex: 1;
  padding: 32px 24px 64px;
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
}

/* ─── Hero ───────────────────────────────────────────────── */
.hero {
  margin-bottom: 40px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.hero__tag {
  display: inline-block;
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 3px 8px;
  border-radius: 4px;
  margin-bottom: 14px;
}
.hero__title {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: #fff;
  margin-bottom: 16px;
}
.hero__lead {
  font-size: 16px;
  color: var(--muted);
  max-width: 600px;
  line-height: 1.7;
  margin-bottom: 16px;
}
.hero__disclaimer {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  border-left: 2px solid var(--accent);
  padding-left: 12px;
  line-height: 1.6;
  max-width: 640px;
}

/* ─── Privacy inline ─────────────────────────────────────── */
.privacy-inline {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ─── Tabs ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 32px;
}
.tab-btn {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  font-size: 13px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 10px 16px;
  cursor: pointer;
  transition: all 0.2s;
  margin-bottom: -1px;
}
.tab-btn:hover { color: var(--text); }
.tab-btn.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ─── Tab panels ─────────────────────────────────────────── */
.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ─── Card ───────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 24px;
}
.card__title {
  font-size: 13px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

/* ─── Grid layouts ───────────────────────────────────────── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .grid-3 { grid-template-columns: 1fr; }
  .main { padding: 20px 16px 48px; }
}

/* ─── Form elements ───────────────────────────────────────── */
.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 600px) {
  .form-row { grid-template-columns: 1fr; }
}
label, .label {
  font-size: 11px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
input[type="text"],
input[type="number"],
input[type="url"],
select,
textarea {
  background: var(--surface2);
  border: 1px solid var(--border2);
  color: var(--text);
  font-family: var(--font-display);
  font-size: 14px;
  padding: 8px 12px;
  border-radius: var(--radius);
  outline: none;
  transition: border-color 0.2s;
  width: 100%;
}
input[type="text"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
select:focus,
textarea:focus {
  border-color: var(--accent);
}
input[type="color"] {
  -webkit-appearance: none;
  width: 48px;
  height: 36px;
  border: 1px solid var(--border2);
  border-radius: var(--radius);
  background: var(--surface2);
  padding: 2px;
  cursor: pointer;
}
input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 4px;
  background: var(--border2);
  border-radius: 2px;
  outline: none;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
  cursor: pointer;
}
input[type="file"] {
  background: var(--surface2);
  border: 1px dashed var(--border2);
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 16px;
  border-radius: var(--radius);
  width: 100%;
  cursor: pointer;
  transition: border-color 0.2s;
}
input[type="file"]:hover { border-color: var(--accent); color: var(--accent); }
.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
}
input[type="checkbox"] {
  -webkit-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid var(--border2);
  border-radius: 4px;
  background: var(--surface2);
  cursor: pointer;
  position: relative;
}
input[type="checkbox"]:checked {
  background: var(--accent);
  border-color: var(--accent);
}
input[type="checkbox"]:checked::after {
  content: '✓';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: #000;
  font-size: 11px;
  font-weight: 700;
}

/* ─── Buttons ─────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-mono);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}
.btn:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #000;
  border-color: var(--accent);
}
.btn-primary:hover:not(:disabled) { background: #d4ff33; }

.btn-secondary {
  background: var(--surface2);
  color: var(--text);
  border-color: var(--border2);
}
.btn-secondary:hover:not(:disabled) { border-color: var(--accent); color: var(--accent); }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border-color: var(--danger);
}
.btn-danger:hover:not(:disabled) { background: var(--danger); color: #fff; }

.btn-sm {
  padding: 6px 12px;
  font-size: 11px;
}
.btn-full { width: 100%; }
.btn-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

/* ─── Stamp Library ───────────────────────────────────────── */
.library-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.library-count {
  font-size: 12px;
  font-family: var(--font-mono);
  color: var(--muted);
}
.stamps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.stamp-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.2s;
  cursor: pointer;
}
.stamp-card:hover { border-color: var(--accent); }
.stamp-card__preview {
  height: 100px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px;
  overflow: hidden;
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.stamp-card__info {
  padding: 12px;
}
.stamp-card__name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 4px;
}
.stamp-card__type {
  font-size: 10px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.stamp-card__actions {
  display: flex;
  gap: 4px;
  padding: 8px 12px;
  border-top: 1px solid var(--border);
}

/* ─── Presets ─────────────────────────────────────────────── */
.presets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 10px;
}
.preset-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}
.preset-chip:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
  color: var(--accent);
}

/* ─── Stamp Editor Layout ────────────────────────────────── */
.editor-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 24px;
  min-height: 400px;
}
@media (max-width: 900px) {
  .editor-layout { grid-template-columns: 1fr; }
}
.editor-controls {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  overflow-y: auto;
  max-height: 600px;
}
.editor-canvas-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  min-height: 400px;
}
#stampCanvas {
  border-radius: var(--radius);
}

/* ─── Batch Dropzone ───────────────────────────────────────── */
.dropzone {
  border: 2px dashed var(--border2);
  border-radius: var(--radius-lg);
  padding: 48px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  background: var(--surface);
}
.dropzone:hover,
.dropzone.drag-over {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.dropzone__icon {
  font-size: 32px;
  margin-bottom: 12px;
  display: block;
}
.dropzone__title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}
.dropzone__hint {
  font-size: 12px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.dropzone.has-files {
  padding: 16px;
}

/* ─── PDF list ─────────────────────────────────────────────── */
.pdf-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}
.pdf-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 14px;
  font-size: 13px;
}
.pdf-item__icon {
  font-size: 20px;
  flex-shrink: 0;
}
.pdf-item__name {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-mono);
  font-size: 12px;
}
.pdf-item__size {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
}
.pdf-item__remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 16px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}
.pdf-item__remove:hover { color: var(--danger); background: rgba(255,68,68,0.1); }

/* ─── Stamp selector chips ────────────────────────────────── */
.stamp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}
.stamp-chip {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 5px 12px;
  font-size: 12px;
  font-family: var(--font-mono);
  cursor: pointer;
  transition: all 0.2s;
  color: var(--muted);
}
.stamp-chip:hover { border-color: var(--accent); color: var(--accent); }
.stamp-chip.selected {
  background: var(--accent);
  border-color: var(--accent);
  color: #000;
  font-weight: 700;
}

/* ─── Batch preview thumbnails ─────────────────────────────── */
.batch-stamps {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 16px 0;
}
.batch-stamp-thumb {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
  font-size: 11px;
  font-family: var(--font-mono);
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--muted);
}

/* ─── Batch actions ────────────────────────────────────────── */
.batch-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}

/* ─── Status messages ──────────────────────────────────────── */
.status-bar {
  padding: 10px 16px;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: var(--font-mono);
  margin-top: 12px;
  display: none;
}
.status-bar.show { display: block; }
.status-bar.success {
  background: rgba(68, 255, 136, 0.1);
  border: 1px solid var(--success);
  color: var(--success);
}
.status-bar.error {
  background: rgba(255, 68, 68, 0.1);
  border: 1px solid var(--danger);
  color: var(--danger);
}

/* ─── Modal ───────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 100;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal-overlay.show { display: flex; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border2);
  border-radius: var(--radius-lg);
  padding: 28px;
  max-width: 480px;
  width: 100%;
  box-shadow: var(--shadow);
}
.modal__title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #fff;
}
.modal__actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* ─── Type selector ───────────────────────────────────────── */
.type-selector {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.type-btn {
  flex: 1;
  padding: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: 12px;
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  cursor: pointer;
  text-align: center;
  transition: all 0.2s;
}
.type-btn:hover { border-color: var(--border2); color: var(--text); }
.type-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

/* ─── Progress ────────────────────────────────────────────── */
.progress-bar-wrap {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 8px;
}
.progress-bar {
  height: 100%;
  background: var(--accent);
  transition: width 0.3s;
  width: 0%;
}

/* ─── Long content / honesty section ─────────────────────── */
.long-content {
  max-width: 960px;
  margin: 24px auto 0;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
}
.long-content h2 {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 12px;
  letter-spacing: 0.02em;
}
.long-content ul { padding-left: 20px; }
.long-content li { margin-bottom: 6px; }
.long-content li::marker { color: var(--accent); }

/* ─── Footer ──────────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
  text-align: center;
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}
.footer__disclaimer {
  margin-top: 8px;
  font-size: 11px;
  text-transform: none;
  letter-spacing: 0;
  line-height: 1.6;
}

/* ─── Donation toast ──────────────────────────────────────── */
.donation-toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 200;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.4s ease;
  pointer-events: none;
}
.donation-toast.show {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.donation-toast__inner {
  background: var(--surface);
  border: 1px solid var(--border2);
  padding: 14px 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 320px;
}
.donation-toast__icon { color: var(--accent); flex-shrink: 0; }
.donation-toast__text { flex: 1; }
.donation-toast__title {
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 2px;
}
.donation-toast__sub {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-mono);
  line-height: 1.4;
}
.donation-toast__actions {
  display: flex;
  flex-direction: column;
  gap: 4px;
  border-left: 1px solid var(--border);
  padding-left: 12px;
}
.donation-toast__close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-mono);
  padding: 4px;
  text-align: center;
}
.donation-toast__close:hover { color: var(--text); }

/* ─── Donate button style (per §4.4 neutral copy) ─────────── */
a.btn-donate {
  color: var(--accent);
  text-decoration: none;
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 8px;
}
a.btn-donate:hover { text-decoration: underline; }
