/* ============================================================
   styles.css — Remove Metadata
   Token-driven foundation + shared chrome
   ============================================================ */

/* ── 1. Design tokens ────────────────────────────────────── */
:root {
  --canvas: #f6f9fb;
  --surface: #ffffff;
  --primary: #0d9488;
  --primary-hover: #0f766e;
  --primary-text: #0f766e;
  --primary-soft: #ccfbf1;
  --ink: #0f172a;
  --muted: #475569;
  --border: #e2e8f0;
  --success: #16a34a;
  --processing: #f59e0b;
  --error: #dc2626;
  --radius-card: 16px;
  --radius-pill: 999px;
  --shadow-card: 0 1px 2px rgba(15,23,42,.04), 0 8px 24px rgba(15,23,42,.06);
  --space: 1rem;
  --maxw: 880px;
  --font: "Nunito Sans", -apple-system, system-ui, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
}

/* ── 2. Reset ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
/* The `hidden` attribute must always win over component display rules
   (e.g. .badge { display: inline-flex }), otherwise hidden elements show. */
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--font);
  font-size: 1.05rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--canvas);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

/* ── 3. Base typography ──────────────────────────────────── */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  line-height: 1.25;
  font-weight: 700;
  color: var(--ink);
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(1.75rem, 4vw, 2.5rem); }
h2 { font-size: clamp(1.25rem, 3vw, 1.75rem); }
h3 { font-size: 1.25rem; }

p {
  margin: 0 0 1em;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--primary-text);
  text-decoration: underline;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--primary-hover);
}

/* ── 4. Layout ───────────────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: calc(var(--space) * 1.5);
}

/* ── 5. Site header ──────────────────────────────────────── */
/* Sticky glass effect: tinted blur keeps context visible while
   protecting nav from content bleed — fitting for a privacy tool */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: var(--space);
}

/* Logo area — inline-SVG shield + wordmark */
.site-header__logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--ink);
  font-weight: 700;
  font-size: 1.1rem;
  letter-spacing: -0.02em;
  white-space: nowrap;
  flex-shrink: 0;
}

.site-header__logo svg {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  color: var(--primary);
  fill: currentColor;
}

.site-header__logo:hover {
  color: var(--primary);
  text-decoration: none;
}

/* ── 6. Navigation ───────────────────────────────────────── */
.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  flex-wrap: wrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.375rem 0.875rem;
  border-radius: var(--radius-pill);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover {
  background: var(--primary-soft);
  color: var(--primary-hover);
  text-decoration: none;
}

.nav-link.is-active {
  background: var(--primary);
  color: #ffffff;
}

.nav-link.is-active:hover {
  background: var(--primary-hover);
  color: #ffffff;
  text-decoration: none;
}

/* ── 7. Hero block ───────────────────────────────────────── */
/* Signature element: soft radial teal glow at the top of the hero.
   Evokes a "scanning spotlight" — a deliberate privacy-tool metaphor.
   Subtle enough to feel ambient, distinctive enough to be remembered. */
.hero {
  padding: calc(var(--space) * 3) 0 calc(var(--space) * 2);
  text-align: center;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, var(--primary-soft) 0%, transparent 75%);
}

.hero h1 {
  margin-bottom: 0.5rem;
}

.hero p {
  color: var(--muted);
  max-width: 52ch;
  margin-inline: auto;
  font-size: 1.1rem;
}

/* ── 8. Card ─────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: calc(var(--space) * 1.75);
  border: 1px solid var(--border);
}

/* ── 9. Buttons ──────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6em 1.4em;
  border-radius: var(--radius-pill);
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
  white-space: nowrap;
}

.btn:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--primary);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: 0 4px 12px rgba(13, 148, 136, 0.3);
  transform: translateY(-1px);
  color: #ffffff;
  text-decoration: none;
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ── 10. Alerts ──────────────────────────────────────────── */
.alert {
  padding: 0.875rem 1.125rem;
  border-radius: calc(var(--radius-card) / 2);
  border: 1px solid transparent;
  font-size: 0.95rem;
  line-height: 1.5;
}

.alert-error {
  background: #fef2f2;
  border-color: #fecaca;
  color: #991b1b;
}

/* ── 11. Site footer ─────────────────────────────────────── */
.site-footer {
  margin-top: calc(var(--space) * 4);
  padding: calc(var(--space) * 1.75) 0;
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  color: var(--muted);
}

.site-footer .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.site-footer a {
  color: var(--muted);
  text-underline-offset: 2px;
}

.site-footer a:hover {
  color: var(--primary);
}

/* ── 12. Utility helpers ─────────────────────────────────── */
.muted {
  color: var(--muted);
}

/* ── 13. Card spacing inside main ────────────────────────── */
main > .card,
main > .upload-card {
  margin-top: 1.5rem;
}

/* Counter card — home page metric */
.counter-card   { text-align: center; }
.counter-label  { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; margin-bottom: 0.4rem; }
.counter-value  { font-size: 2.25rem; font-weight: 700; color: var(--primary); margin: 0 0 0.25rem; }
.counter-suffix { font-size: 0.875rem; margin: 0; }

/* ── 14. Dropzone ────────────────────────────────────────── */
.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 2.5rem 1.5rem;
  border: 2px dashed var(--primary);
  border-radius: calc(var(--radius-card) / 1.5);
  cursor: pointer;
  text-align: center;
  color: var(--muted);
  background: transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
  margin-bottom: 1.25rem;
  outline: none;
}

.dropzone:hover,
.dropzone.is-dragover {
  background: var(--primary-soft);
  border-color: var(--primary-hover);
}

.dropzone:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 3px;
}

.dropzone__icon {
  fill: var(--primary);
  opacity: 0.7;
  flex-shrink: 0;
}

.dropzone .link {
  color: var(--primary-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dropzone p {
  margin: 0;
}

/* Turnstile widget: centered, with space above the submit button */
.cf-turnstile-wrapper {
  display: flex;
  justify-content: center;
  margin-bottom: 1rem;
}

/* ── 15. Progress card — steps grid ─────────────────────── */
.steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
  margin-top: 1.5rem;
  text-align: center;
}

.step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.step-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.step-icon {
  fill: var(--muted);
  opacity: 0.5;
}

/* ── 16. SVG progress ring ───────────────────────────────── */
.ring {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
}

.ring-track {
  stroke: var(--border);
  stroke-width: 3;
}

#upload-ring-fill {
  stroke: var(--primary);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 100;
  stroke-dashoffset: 100;
  transition: stroke-dashoffset 0.4s ease;
}

.ring-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-text);
}

/* ── 17. Spinner ─────────────────────────────────────────── */
.spinner {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
}

.spinner svg {
  fill: var(--processing);
  animation: spin 1.2s linear infinite;
}

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

.is-error svg {
  fill: var(--error);
  animation: none;
}

/* ── 18. Badge ───────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25em 0.75em;
  border-radius: var(--radius-pill);
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.4;
}

.badge-success {
  background: #dcfce7;
  color: var(--success);
  border: 1px solid #bbf7d0;
}

/* ── 19. Pulse — ready download button ───────────────────── */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(13, 148, 136, 0.4); }
  50%       { box-shadow: 0 0 0 8px rgba(13, 148, 136, 0); }
}

.pulse {
  animation: pulse 1.8s ease-in-out infinite;
}

/* ── 20. FAQ accordion — native <details> ────────────────── */
/* Page-level h1 breathing room (FAQ, Privacy pages) */
main > h1 {
  padding-top: calc(var(--space) * 2.5);
  padding-bottom: 0.5rem;
}

details {
  border-bottom: 1px solid var(--border);
}

details:last-child {
  border-bottom: none;
}

details > summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.875rem 0;
  cursor: pointer;
  font-weight: 600;
  color: var(--ink);
  gap: 0.5rem;
  user-select: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

details > summary::after {
  content: "";
  display: block;
  width: 1.1em;
  height: 1.1em;
  flex-shrink: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%230d9488' d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E") center/contain no-repeat;
  transition: transform 0.2s ease;
}

details[open] > summary::after {
  transform: rotate(180deg);
}

details > summary:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
}

details > div {
  padding: 0 0 0.875rem;
  color: var(--muted);
}

/* ── 21. Responsive ──────────────────────────────────────── */
@media (max-width: 600px) {
  .site-header .container {
    flex-direction: column;
    align-items: flex-start;
    padding-block: 0.75rem;
    min-height: auto;
  }

  .nav {
    gap: 0.125rem;
  }

  .nav-link {
    padding: 0.3rem 0.7rem;
    font-size: 0.85rem;
  }

  .hero {
    padding: calc(var(--space) * 2) 0 var(--space);
  }

  .steps {
    grid-template-columns: 1fr;
  }
}
