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

/* The [hidden] attribute and a class like .dl-card (display: flex) have equal
   CSS specificity — whichever is declared later in the cascade wins, and an
   author-stylesheet class rule always comes after the browser's built-in
   [hidden] rule. Without this, any element that's both .dl-card and [hidden]
   stays visible (and clickable) despite being "hidden" — this was silently
   true for every such element in the app until now. !important forces
   [hidden] to always win regardless of what other display rules a hidden
   element's classes carry. */
[hidden] { display: none !important; }

:root {
  --bg:         #f8f9fb;
  --bg-subtle:  #eef1f5;
  --surface:    #ffffff;
  --border:     #d8dde6;
  --text:       #1a1e2e;
  --text-muted: #5a6178;
  --accent:     #1a4fa8;
  --accent-dark:#133a80;
  --accent-lt:  #e8eef9;
  --green:      #1a7a4a;
  --green-lt:   #e6f4ec;
  --red:        #c0392b;
  --radius:     10px;
  --shadow:     0 2px 12px rgba(0,0,0,.08);
  --shadow-lg:  0 6px 32px rgba(0,0,0,.12);
  font-size: 16px;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

/* ── Layout ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }
.container-narrow { max-width: 680px; }

/* ── Header ── */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 100;
}
.site-header .container {
  display: flex; align-items: center; justify-content: space-between;
  padding-top: .9rem; padding-bottom: .9rem;
}
.logo { text-decoration: none; display: flex; align-items: center; gap: .5rem; line-height: 1.1; }
.logo-mark { height: 34px; width: auto; display: block; }
.logo-highlight { font-family: 'Playfair Display', Georgia, serif; font-size: 1.25rem; color: var(--accent); font-weight: 700; }

nav { display: flex; align-items: center; gap: 1rem; }
.nav-lang { font-size: .8rem; font-weight: 600; color: var(--text-muted); text-decoration: none; padding: .2rem .4rem; border-radius: 4px; }
.nav-lang.active { color: var(--accent); background: var(--accent-lt); }

/* ── Buttons ── */
.btn {
  display: inline-block; padding: .65rem 1.4rem; border-radius: var(--radius);
  font-weight: 600; font-size: .95rem; text-decoration: none; cursor: pointer;
  border: 2px solid transparent; transition: all .18s ease; white-space: nowrap;
}
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }
.btn-primary:disabled { opacity: .45; cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--accent); border-color: var(--accent); }
.btn-outline:hover { background: var(--accent-lt); }
.btn-sm { padding: .45rem 1rem; font-size: .85rem; }
.btn-lg { padding: .85rem 1.8rem; font-size: 1.05rem; }

/* ── Footer ── */
.site-footer {
  background: var(--text); color: rgba(255,255,255,.6);
  padding: 2rem 0; font-size: .82rem; text-align: center; margin-top: 4rem;
}
.site-footer a { color: rgba(255,255,255,.75); }
.site-footer p + p { margin-top: .5rem; }

/* ── Hero ── */
.hero { background: linear-gradient(135deg, #0e2d6b 0%, #1a4fa8 60%, #2563c4 100%); color: #fff; padding: 5rem 0 4rem; }
.hero-inner { display: grid; grid-template-columns: 1fr auto; gap: 3rem; align-items: center; }
.hero-eyebrow { font-size: .8rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: rgba(255,255,255,.65); margin-bottom: .75rem; }
.hero h1 { font-family: 'Playfair Display', Georgia, serif; font-size: clamp(2rem, 4vw, 3rem); line-height: 1.15; margin-bottom: 1.25rem; }
.hero-sub { font-size: 1.05rem; color: rgba(255,255,255,.82); max-width: 540px; margin-bottom: 2rem; line-height: 1.7; }
.hero-note { font-size: .8rem; color: rgba(255,255,255,.55); margin-top: .75rem; }
.hero-shield { opacity: .9; }
.shield-graphic svg { width: 140px; height: 160px; }

/* ── Sections ── */
.section { padding: 4.5rem 0; }
.section-title { font-family: 'Playfair Display', Georgia, serif; font-size: 1.85rem; text-align: center; margin-bottom: 2.5rem; color: var(--text); }
.bg-subtle { background: var(--bg-subtle); }

/* ── Steps ── */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.step { text-align: center; padding: 1.5rem; }
.step-num { width: 48px; height: 48px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 1.25rem; font-weight: 700; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.step h3 { font-size: 1.05rem; margin-bottom: .5rem; }
.step p { color: var(--text-muted); font-size: .92rem; }

/* ── Services ── */
.service-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.service-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.75rem; box-shadow: var(--shadow); }
.service-icon { font-size: 2rem; margin-bottom: .75rem; }
.service-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: .5rem; }
.service-card p { color: var(--text-muted); font-size: .9rem; }

/* ── Privacy block ── */
.privacy-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: center; }
.privacy-text h2 { font-family: 'Playfair Display', Georgia, serif; font-size: 1.6rem; margin-bottom: 1.25rem; }
.privacy-list { list-style: none; display: flex; flex-direction: column; gap: .6rem; }
.privacy-list li { display: flex; gap: .6rem; font-size: .92rem; }
.check { color: var(--green); font-weight: 700; flex-shrink: 0; }
.privacy-diagram { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; text-align: center; box-shadow: var(--shadow); }
.pd-row { display: flex; align-items: center; justify-content: center; gap: 1rem; margin-bottom: 1rem; }
.pd-node { background: var(--accent-lt); color: var(--accent); font-weight: 600; padding: .6rem 1rem; border-radius: 6px; font-size: .85rem; }
.pd-arrow { font-size: .8rem; color: var(--text-muted); }
.pd-note { font-size: .8rem; color: var(--text-muted); line-height: 1.5; }

/* ── Pricing ── */
.price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.price-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; text-align: center; position: relative; box-shadow: var(--shadow); }
.price-card.featured { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent), var(--shadow-lg); }
.featured-badge { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: #fff; font-size: .72rem; font-weight: 700; padding: .2rem .75rem; border-radius: 20px; white-space: nowrap; }
.price-card h3 { font-size: 1rem; font-weight: 600; margin-bottom: .75rem; }
.price { font-size: 2rem; font-weight: 700; color: var(--accent); margin-bottom: .75rem; }
.price span { font-size: 1rem; font-weight: 400; color: var(--text-muted); }
.price-card p { color: var(--text-muted); font-size: .88rem; margin-bottom: 1.25rem; }

/* ── Upload wizard ── */
.upload-page, .status-page, .download-page { padding: 3rem 0 5rem; }
.upload-page h1, .status-page h1, .download-page h1 {
  font-family: 'Playfair Display', Georgia, serif;
  font-size: 1.9rem; margin-bottom: .5rem;
}
.page-sub { color: var(--text-muted); margin-bottom: 2.5rem; }

.wizard-step { display: none; }
.wizard-step.active { display: block; }

.step-header { display: flex; align-items: center; gap: 1rem; margin-bottom: .75rem; }
.step-badge { width: 36px; height: 36px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: .95rem; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.done-badge { background: var(--green); }
.step-header h2 { font-size: 1.2rem; font-weight: 600; }
.step-desc { color: var(--text-muted); font-size: .92rem; margin-bottom: 1.25rem; }

.input-field {
  width: 100%; padding: .75rem 1rem; border: 1.5px solid var(--border); border-radius: var(--radius);
  font-size: 1rem; margin-bottom: 1rem; background: var(--surface); color: var(--text);
  transition: border-color .15s;
}
.input-field:focus { outline: none; border-color: var(--accent); }
.input-error { border-color: var(--red) !important; }

/* Entropy canvas */
.entropy-canvas {
  width: 100%; height: 180px; border: 2px dashed var(--border); border-radius: var(--radius);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  margin-bottom: 1.25rem; cursor: crosshair; background: var(--bg-subtle); gap: .75rem;
  user-select: none;
}
.entropy-label { font-size: .9rem; color: var(--text-muted); }
.entropy-bar-wrap { width: 60%; height: 10px; background: var(--border); border-radius: 5px; overflow: hidden; }
.entropy-bar { height: 100%; width: 0; background: var(--accent); border-radius: 5px; transition: width .1s; }
.bar-done { background: var(--green); }
.entropy-pct { font-size: .85rem; font-weight: 600; color: var(--accent); }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border); border-radius: var(--radius); padding: 2.5rem;
  text-align: center; background: var(--bg-subtle); margin-bottom: 1.25rem;
  transition: border-color .15s, background .15s; cursor: pointer;
}
.drop-zone.drag-over { border-color: var(--accent); background: var(--accent-lt); }
.drop-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.file-label { color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline; }
.file-name { margin-top: .5rem; font-size: .88rem; color: var(--green); font-weight: 500; }

.upload-note { font-size: .8rem; color: var(--text-muted); margin-top: .75rem; }

/* Spinner */
.encrypt-status { display: flex; align-items: center; gap: .75rem; padding: .75rem 0; }
.encrypt-status[hidden] { display: none; }
.spinner { width: 20px; height: 20px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Job ID box */
.job-id-box {
  font-family: 'Courier New', monospace; font-size: .85rem; background: var(--bg-subtle);
  border: 1px solid var(--border); padding: .6rem 1rem; border-radius: 6px;
  margin-bottom: 1.25rem; word-break: break-all; color: var(--text-muted);
}

.key-warning { background: #fff8e1; border: 1px solid #ffe082; border-radius: 8px; padding: .9rem 1.1rem; font-size: .86rem; margin-top: 1.5rem; line-height: 1.5; }

/* ── Status timeline ── */
.status-card { display: flex; align-items: center; gap: 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; margin-bottom: 2rem; box-shadow: var(--shadow); }
.status-timeline { display: flex; flex-direction: column; gap: 0; margin-bottom: 2rem; }
.tl-step { display: flex; align-items: center; gap: 1rem; padding: .75rem 0; border-left: 2px solid var(--border); padding-left: 1.25rem; position: relative; }
.tl-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--border); border: 2px solid var(--surface); position: absolute; left: -7px; flex-shrink: 0; }
.tl-step.tl-done .tl-dot { background: var(--green); border-color: var(--green); }
.tl-step.tl-active .tl-dot { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-lt); }
.tl-step.tl-active .tl-label { color: var(--accent); font-weight: 600; }
.tl-step.tl-done .tl-label { color: var(--green); }
.tl-label { font-size: .9rem; color: var(--text-muted); }

/* ── Download ── */
.dl-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); margin-bottom: 1.5rem; display: flex; flex-direction: column; gap: 1rem; }
.error-box { background: #fdecea; border: 1px solid #f5c6c2; border-radius: 8px; padding: .9rem 1.1rem; color: var(--red); font-size: .88rem; }

/* ── Responsive ── */
@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-shield { display: none; }
  .steps { grid-template-columns: 1fr; }
  .service-grid { grid-template-columns: 1fr; }
  .price-grid { grid-template-columns: 1fr; }
  .privacy-inner { grid-template-columns: 1fr; }
}

/* Bilingual inline pattern (DE primary, EN muted) — used in admin pages so
   there's one code path instead of a separate lang-toggle for internal tools. */
.en { color: var(--text-muted); font-weight: 400; }
