/* styles.css · rellenar-pdf-guardado · 1000HW
 * Vanilla CSS, mobile-first, WCAG 2.1 AA, prefers-reduced-motion respected.
 * Cache-bust: ?v=1
 */

*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  --bg: #050505;
  --bg-soft: #0d0d0d;
  --bg-card: #131313;
  --bg-card-hover: #1a1a1a;
  --border: #2a2a2a;
  --text: #f5f5f5;
  --text-soft: #d0d0d0;
  --muted: #9a9a9a;
  --accent: #ccff00;
  --accent-soft: #d9ff66;
  --accent-ink: #050505;
  --warning: #ffb547;
  --error: #ff5a5a;
  --success: #44d488;
  --info: #5dabff;
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, 0.7);
  --font-base: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Inter', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --font-mono: ui-monospace, 'SFMono-Regular', Menlo, Monaco, Consolas, monospace;
  --transition: 180ms cubic-bezier(0.4, 0, 0.2, 1);
}

html {
  font-family: var(--font-base);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  font-size: 16px;
}

/* ─── Skip link (WCAG) ─────────────────────────────────── */
.skip-link {
  position: absolute;
  left: -10000px;
  top: 0;
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px 18px;
  font-weight: 700;
  border-radius: 0 0 var(--radius-sm) 0;
  z-index: 1000;
}
.skip-link:focus {
  left: 0;
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* ─── Focus visible (WCAG) ────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ─── SR only ──────────────────────────────────────────── */
.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ─── NAV ──────────────────────────────────────────────── */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(5, 5, 5, 0.92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav__back {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--text-soft);
  text-decoration: none;
  font-size: 0.9rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: background var(--transition);
}
.nav__back:hover,
.nav__back:focus-visible {
  background: var(--bg-card);
  color: var(--accent);
}
.nav__arrow {
  font-size: 1.1rem;
}
.nav__brand {
  flex: 1;
  text-align: right;
  font-weight: 800;
  letter-spacing: 0.06em;
  font-size: 1rem;
  color: var(--text);
}
.nav__brand .accent {
  color: var(--accent);
}
.lang-toggle {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  margin-left: auto;
}
.lang-toggle:hover {
  background: var(--accent);
  color: var(--accent-ink);
  border-color: var(--accent);
}

/* ─── OFFLINE BANNER ───────────────────────────────────── */
.offline-banner {
  background: rgba(255, 181, 71, 0.12);
  border-bottom: 1px solid var(--warning);
  color: var(--warning);
  padding: 0.6rem 1rem;
  text-align: center;
  font-size: 0.875rem;
}

/* ─── MAIN / Container ─────────────────────────────────── */
.main {
  padding: 2rem 1rem 4rem;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
}

/* ─── HERO ─────────────────────────────────────────────── */
.hero-header {
  margin-bottom: 2rem;
  text-align: left;
}
.hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-bottom: 1rem;
}
.tag {
  display: inline-block;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
}
.tag--private,
.tag--offline,
.tag--bil,
.tag--acro,
.tag--free,
.tag--send {
  border-color: var(--accent);
  color: var(--accent);
}
.hero-h1 {
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 1rem;
}
.hero-h1 .accent {
  color: var(--accent);
}
.hero-lede {
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: var(--text-soft);
  max-width: 78ch;
  margin: 0 0 1.5rem;
}
.hero-disclaimer {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  background: rgba(255, 181, 71, 0.08);
  border: 1px solid rgba(255, 181, 71, 0.3);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  margin-top: 1rem;
}
.disclaimer-icon {
  color: var(--warning);
  flex-shrink: 0;
  margin-top: 2px;
}
.hero-disclaimer p {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-soft);
  line-height: 1.55;
}

/* ─── Tool area ────────────────────────────────────────── */
.tool-area {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 3rem;
  box-shadow: var(--shadow-md);
}

/* Status bar */
.status-bar {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
}
.status-bar__dot {
  width: 0.6rem; height: 0.6rem;
  border-radius: 50%;
  background: var(--muted);
}
.status-bar--ready .status-bar__dot { background: var(--success); }
.status-bar--loading .status-bar__dot {
  background: var(--info);
  animation: pulse 1.2s ease-in-out infinite;
}
.status-bar--error {
  border-color: var(--error);
  color: var(--error);
}
.status-bar--error .status-bar__dot { background: var(--error); }
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(1.4); }
}

/* ─── Dropzone ─────────────────────────────────────────── */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  border: 2px dashed var(--border);
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.5rem;
  background: var(--bg-card);
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}
.dropzone:hover,
.dropzone:focus-visible {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}
.dropzone--active {
  border-color: var(--accent);
  background: rgba(204, 255, 0, 0.05);
  transform: scale(1.005);
}
.dropzone--has-file {
  border-style: solid;
  border-color: var(--success);
}
.dropzone__icon {
  width: 64px;
  height: 64px;
  color: var(--accent);
  margin-bottom: 0.75rem;
  opacity: 0.9;
}
.dropzone__title {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 0.5rem 0 0.25rem;
  color: var(--text);
}
.dropzone__hint {
  font-size: 0.95rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}
.dropzone__format {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.25rem 0 0;
}
.dropzone__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

/* ─── File info ────────────────────────────────────────── */
.file-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin: 1rem 0;
}
.file-info__item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: 1;
  min-width: 200px;
}
.file-info__icon { font-size: 1.5rem; }
.file-info__name {
  font-weight: 600;
  word-break: break-all;
}
.file-info__meta {
  display: flex;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ─── Mode selector ────────────────────────────────────── */
.mode-selector {
  margin: 1.25rem 0;
}
.mode-selector__label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 0.5rem;
}
.mode-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 0.5rem;
}
.mode-option {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  text-align: left;
  cursor: pointer;
  color: var(--text-soft);
  font-family: inherit;
  transition: all var(--transition);
}
.mode-option:hover {
  border-color: var(--accent);
}
.mode-option--active {
  border-color: var(--accent);
  background: rgba(204, 255, 0, 0.06);
}
.mode-option__title {
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.25rem;
}
.mode-option__desc {
  font-size: 0.8rem;
  color: var(--muted);
}
.mode-detected {
  background: rgba(68, 212, 136, 0.08);
  border: 1px solid rgba(68, 212, 136, 0.25);
  border-radius: var(--radius);
  padding: 0.6rem 0.9rem;
  margin: 0.75rem 0;
  font-size: 0.875rem;
  color: var(--success);
}

/* ─── Workspace (split layout) ─────────────────────────── */
.workspace {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 1.25rem;
  margin: 1.25rem 0;
}
@media (max-width: 860px) {
  .workspace { grid-template-columns: 1fr; }
}

/* Fields panel (AcroForm) */
.fields-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  max-height: 600px;
  overflow-y: auto;
}
.fields-panel__title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin: 0 0 0.75rem;
}
.fields-panel__count {
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 0.7rem;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}
.fields-panel__empty {
  font-size: 0.875rem;
  color: var(--muted);
  text-align: center;
  padding: 2rem 0.5rem;
}
.field-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin-bottom: 0.6rem;
  transition: all var(--transition);
}
.field-card--filled {
  border-color: var(--success);
  background: rgba(68, 212, 136, 0.05);
}
.field-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  gap: 0.5rem;
}
.field-card__name {
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.field-card__type {
  font-size: 0.7rem;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  font-weight: 600;
  flex-shrink: 0;
}
.field-card__type--text,
.field-card__type--multiline { background: rgba(93, 171, 255, 0.15); color: var(--info); }
.field-card__type--checkbox { background: rgba(68, 212, 136, 0.15); color: var(--success); }
.field-card__type--radio { background: rgba(204, 255, 0, 0.15); color: var(--accent); }
.field-card__type--dropdown,
.field-card__type--optionlist { background: rgba(255, 181, 71, 0.15); color: var(--warning); }
.field-card__type--signature,
.field-card__type--button { background: rgba(255, 90, 90, 0.15); color: var(--error); }
.field-card__type--unknown { background: var(--bg-card-hover); color: var(--muted); }

.field-card__input,
.field-card__select {
  width: 100%;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.5rem 0.65rem;
  font-family: inherit;
  font-size: 0.9rem;
}
.field-card__input:focus,
.field-card__select:focus {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}
.field-card__input--multiline {
  resize: vertical;
  min-height: 60px;
}
.field-card__checkbox {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
}
.field-card__radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
.field-card__radio {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.5rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.field-card__radio--selected {
  background: rgba(204, 255, 0, 0.08);
}
.field-card__badges {
  display: flex;
  gap: 0.4rem;
  margin-top: 0.5rem;
}
.field-card__badge {
  font-size: 0.7rem;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
}
.field-card__badge--req { background: rgba(255, 181, 71, 0.15); color: var(--warning); }
.field-card__badge--ro { background: rgba(255, 90, 90, 0.15); color: var(--error); }

/* Preview */
.preview {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.preview__toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-soft);
}
.preview__pagination {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.preview__page-num {
  background: var(--bg-card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.25rem 0.5rem;
  width: 4rem;
  text-align: center;
  font-size: 0.875rem;
}
.preview__canvas-wrap {
  position: relative;
  padding: 1rem;
  min-height: 400px;
  overflow: auto;
  flex: 1;
  text-align: center;
  background: #1f1f1f;
}
.preview__canvas {
  box-shadow: var(--shadow-md);
  max-width: 100%;
  height: auto;
}
.preview__empty {
  color: var(--muted);
  text-align: center;
  padding: 3rem 0;
}

/* Overlay layer */
.overlay-layer {
  position: absolute;
  pointer-events: auto;
  cursor: crosshair;
  z-index: 5;
}
.overlay-box {
  position: absolute;
  background: rgba(255, 255, 255, 0.95);
  border: 1.5px solid var(--accent);
  color: #000;
  border-radius: 4px;
  padding: 4px 8px;
  font-family: var(--font-base);
  cursor: move;
  display: flex;
  align-items: center;
  user-select: none;
  word-break: break-word;
  line-height: 1.2;
}
.overlay-box--editing {
  outline: 2px solid var(--accent);
  background: #fff;
  cursor: text;
}
.overlay-box__remove {
  position: absolute;
  top: -8px; right: -8px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: none;
  background: var(--error);
  color: #fff;
  font-size: 0.8rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Signature ────────────────────────────────────────── */
.signature-panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
}
.signature-panel__title {
  font-weight: 700;
  margin-bottom: 0.3rem;
}
.signature-panel__instruction {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0 0 0.75rem;
}
.signature-canvas-wrap {
  background: #fff;
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  position: relative;
  min-height: 140px;
}
.signature-canvas {
  display: block;
  width: 100%;
  height: 140px;
  cursor: crosshair;
  touch-action: none;
}
.signature-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}
.signature-honesty {
  font-size: 0.75rem;
  color: var(--muted);
  font-style: italic;
  margin: 0.5rem 0 0;
}

/* ─── Option row (flatten) ────────────────────────────── */
.option-row {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.85rem 1rem;
  margin-top: 1rem;
}
.option-row__checkbox {
  padding-top: 2px;
}
.option-row__body { flex: 1; }
.option-row__title {
  font-weight: 600;
  cursor: pointer;
}
.option-row__desc {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0.25rem 0 0;
}

/* ─── Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.7rem 1.25rem;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  font-family: inherit;
  transition: all var(--transition);
  text-decoration: none;
  line-height: 1.2;
}
.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover:not(:disabled),
.btn--primary:focus-visible {
  background: var(--accent-soft);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.btn--secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}
.btn--secondary:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}
.btn--ghost {
  background: transparent;
  color: var(--text-soft);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--bg-card);
  color: var(--text);
}
.btn--danger {
  background: transparent;
  color: var(--error);
  border-color: var(--error);
}
.btn--danger:hover {
  background: rgba(255, 90, 90, 0.12);
}
.btn--lg {
  padding: 0.85rem 1.5rem;
  font-size: 1rem;
}
.btn--sm {
  padding: 0.4rem 0.85rem;
  font-size: 0.825rem;
}
.btn--block {
  width: 100%;
}

/* ─── Privacy notice ──────────────────────────────────── */
.privacy-notice {
  text-align: center;
  font-size: 0.875rem;
  color: var(--muted);
  margin: 1rem 0 0;
  font-style: italic;
}

/* ─── STEPS ────────────────────────────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 2.5rem 0;
}
.step-card {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.step-card__num {
  display: inline-block;
  background: var(--accent);
  color: var(--accent-ink);
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-weight: 800;
  text-align: center;
  line-height: 32px;
  margin-bottom: 0.75rem;
}
.step-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 0.4rem;
  color: var(--text);
}
.step-card__desc {
  font-size: 0.875rem;
  color: var(--muted);
  margin: 0;
}

/* ─── FAQ ──────────────────────────────────────────────── */
.faq {
  margin: 2.5rem 0;
}
.faq__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1rem;
}
.faq__list {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.faq__item {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  overflow: hidden;
}
.faq__item[open] {
  background: var(--bg-card);
}
.faq__question {
  padding: 1rem 1.25rem;
  font-weight: 600;
  cursor: pointer;
  list-style: none;
  color: var(--text);
  position: relative;
}
.faq__question::-webkit-details-marker { display: none; }
.faq__question::after {
  content: '+';
  position: absolute;
  right: 1.25rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.5rem;
  color: var(--accent);
  font-weight: 700;
}
.faq__item[open] .faq__question::after { content: '−'; }
.faq__answer {
  padding: 0 1.25rem 1rem;
  margin: 0;
  color: var(--text-soft);
  font-size: 0.92rem;
}

/* ─── About / Honesty ──────────────────────────────────── */
.about {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem;
  margin: 2.5rem 0;
  line-height: 1.7;
}
.about__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 0 1rem;
}
.about h2 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--accent);
  margin: 1.25rem 0 0.5rem;
}
.about__p {
  font-size: 0.95rem;
  color: var(--text-soft);
  margin: 0 0 0.85rem;
}
.about code {
  background: var(--bg);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--accent);
}

/* ─── Footer ───────────────────────────────────────────── */
.footer {
  border-top: 1px solid var(--border);
  padding: 1.5rem 1rem;
  text-align: center;
}
.footer__inner {
  max-width: 1200px;
  margin: 0 auto;
}
.footer__disclaimer {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.6rem;
  line-height: 1.5;
}
.footer__brand {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  margin: 0;
  font-weight: 700;
}

/* ─── Modal (error + submit) ──────────────────────────── */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
[hidden] { display: none !important; }
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  z-index: 1;
}
.modal-content {
  position: relative;
  z-index: 2;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 640px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}
.modal__title {
  font-size: 1.25rem;
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.modal__msg {
  font-size: 0.95rem;
  color: var(--text-soft);
  margin: 0 0 1rem;
}
.modal__actions {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
}

/* Submit modal — wider, two columns on desktop */
.submit-modal__content {
  max-width: 880px;
}
.submit-modal__lead {
  font-size: 0.92rem;
  color: var(--text-soft);
  margin: 0 0 1rem;
  line-height: 1.5;
}
.submit-section-label {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 700;
  margin: 1rem 0 0.5rem;
}
.submit-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
}
.submit-option {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
  color: var(--text);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.4rem;
  position: relative;
  min-height: 110px;
}
.submit-option:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}
.submit-option--primary {
  border-color: var(--accent);
  background: rgba(204, 255, 0, 0.05);
}
.submit-option__icon {
  width: 22px;
  height: 22px;
  color: var(--accent);
}
.submit-option--primary .submit-option__icon {
  color: var(--accent);
}
.submit-option__title {
  font-weight: 700;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}
.submit-option__warn {
  font-size: 0.7rem;
  background: var(--warning);
  color: var(--bg);
  border-radius: 999px;
  padding: 0.05rem 0.4rem;
  font-weight: 700;
}
.submit-option__desc {
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}
.submit-option__warning {
  font-size: 0.72rem;
  color: var(--warning);
  margin-top: auto;
  font-style: italic;
}

/* Submit detail panel (after clicking an option) */
.submit-detail {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-top: 1rem;
}
.submit-detail__title {
  font-weight: 700;
  margin: 0 0 0.5rem;
}
.submit-detail__warning {
  background: rgba(255, 181, 71, 0.08);
  border: 1px solid rgba(255, 181, 71, 0.3);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
  font-size: 0.82rem;
  color: var(--warning);
  margin: 0.5rem 0;
}
.submit-detail__label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0.6rem 0 0.25rem;
}
.submit-detail__input,
.submit-detail__textarea {
  width: 100%;
  background: var(--bg-soft);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.75rem;
  font-family: inherit;
  font-size: 0.9rem;
}
.submit-detail__input:focus,
.submit-detail__textarea:focus {
  border-color: var(--accent);
  outline: 1px solid var(--accent);
}
.submit-detail__textarea { min-height: 60px; resize: vertical; }
.submit-detail__check-row {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  padding: 0.5rem 0;
}
.submit-detail__check-row input[type="checkbox"] {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}
.submit-detail__check-row label {
  font-size: 0.85rem;
  color: var(--text-soft);
}
.submit-detail__result {
  background: var(--bg-card);
  border: 1px solid var(--success);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  margin: 0.5rem 0;
  font-size: 0.875rem;
}
.submit-detail__result-link {
  word-break: break-all;
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 0.85rem;
  display: block;
  margin: 0.4rem 0;
}
.submit-detail__actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-top: 0.75rem;
}
.submit-detail__error {
  background: rgba(255, 90, 90, 0.08);
  border: 1px solid var(--error);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
  color: var(--error);
  font-size: 0.875rem;
  margin: 0.5rem 0;
}

/* ─── Donation toast ──────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 1rem;
  right: 1rem;
  z-index: 100;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow-lg);
  max-width: 360px;
  animation: toastSlideIn 0.4s ease-out;
}
@keyframes toastSlideIn {
  from { transform: translateY(100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.toast__inner {
  padding: 0.85rem 1rem;
  display: flex;
  gap: 0.75rem;
  align-items: center;
}
.toast__icon { color: var(--accent); flex-shrink: 0; }
.toast__body { flex: 1; }
.toast__body p { margin: 0; font-size: 0.85rem; color: var(--text-soft); }
.toast__actions {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  align-items: stretch;
}
.toast__cta {
  background: var(--accent);
  color: var(--accent-ink);
  text-decoration: none;
  text-align: center;
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 700;
}
.toast__dismiss {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-soft);
  padding: 0.35rem 0.85rem;
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

/* ─── Draft banner ────────────────────────────────────── */
.alert {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: rgba(93, 171, 255, 0.08);
  border: 1px solid rgba(93, 171, 255, 0.25);
  border-radius: var(--radius);
  padding: 0.6rem 0.85rem;
  font-size: 0.875rem;
  margin: 1rem 0;
}

/* ─── Print styles (submit "print to PDF") ────────────── */
@media print {
  body { background: #fff !important; color: #000 !important; }
  .nav, .offline-banner, .footer, .toast,
  .hero-disclaimer, .hero-tags, .hero-lede,
  .dropzone, .file-info, .mode-selector, .mode-detected,
  .fields-panel, .signature-panel, .option-row,
  .privacy-notice, .steps, .faq, .about,
  .preview__toolbar, .modal, .alert,
  .status-bar {
    display: none !important;
  }
  .main, .tool-area, .container, .workspace {
    padding: 0 !important;
    margin: 0 !important;
    border: none !important;
    background: #fff !important;
  }
  .preview {
    border: none !important;
    background: #fff !important;
  }
  .preview__canvas-wrap {
    padding: 0 !important;
    background: #fff !important;
    min-height: 0 !important;
  }
  .preview__canvas, canvas, .overlay-box {
    box-shadow: none !important;
    page-break-inside: avoid;
  }
}

/* ─── Accessibility & motion ───────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* High-contrast / focus ring correction on dark bg for some browsers */
@media (forced-colors: active) {
  .btn { border: 1px solid ButtonText; }
  .submit-option { border: 1px solid ButtonText; }
}

/* Code inline */
code {
  font-family: var(--font-mono);
  background: var(--bg);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}
