:root {
  --ink: #121826;
  --ink-soft: #3d4a5c;
  --paper: #f3efe6;
  --paper-2: #fffcf6;
  --line: #ddd4c6;
  --teal: #0c5f63;
  --teal-dark: #08484c;
  --teal-soft: #d5ecec;
  --gold: #d3942e;
  --gold-dark: #a56a1c;
  --danger: #9b2c2c;
  --danger-soft: #f8e4e4;
  --ok: #1f7a46;
  --ok-soft: #e3f5ea;
  --warn: #9a6b12;
  --warn-soft: #f7edd6;
  --shadow: 0 18px 50px rgba(21, 32, 51, 0.08);
  --radius: 18px;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
  --display: "Fraunces", Georgia, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1100px 420px at 92% -8%, rgba(12, 95, 99, 0.10), transparent 55%),
    radial-gradient(800px 280px at 0% 12%, rgba(227, 162, 58, 0.07), transparent 50%),
    var(--paper);
  line-height: 1.55;
  min-height: 100vh;
}
img, svg { max-width: 100%; display: block; }
a { color: var(--teal-dark); }
h1, h2, h3, .display { font-family: var(--display); font-weight: 560; letter-spacing: -0.02em; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 12px; top: 12px; background: #fff; padding: 8px 12px; z-index: 9; }

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }
.site-header {
  position: sticky; top: 0; z-index: 20;
  backdrop-filter: blur(16px);
  background: rgba(244, 239, 230, 0.9);
  border-bottom: 1px solid var(--line);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; gap: 16px;
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-weight: 700; }
.brand-mark { width: 36px; height: 36px; flex: 0 0 auto; }
.brand-name {
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -0.03em;
  font-size: 1.28rem;
}
.brand-name span { color: var(--teal); }
.brand-name em { font-style: normal; font-size: .72em; color: var(--ink-soft); font-family: var(--font); font-weight: 650; letter-spacing: .04em; margin-left: 4px; }
.admin-header .brand,
.admin-header .brand-name { color: #f4efe6; }
.admin-header .brand-name span { color: #e3a23a; }
.admin-header .brand-name em { color: #c9d4e2; }
.nav-links { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.nav-links a { text-decoration: none; color: var(--ink-soft); padding: 8px 10px; border-radius: 10px; }
.nav-links a:hover { background: rgba(255,255,255,.6); color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 999px; padding: 12px 20px; font: inherit; font-weight: 650;
  text-decoration: none; cursor: pointer; transition: .15s transform, .15s background;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-dark); }
.btn-gold { background: var(--gold); color: #fff; }
.btn-gold:hover { background: var(--gold-dark); }
.btn-ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-wide { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.hero {
  padding: 56px 0 32px;
  display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center;
}
.kicker { text-transform: uppercase; letter-spacing: .16em; font-size: 12px; color: var(--teal); font-weight: 700; }
.hero h1 { font-size: clamp(36px, 6vw, 68px); line-height: 1.05; margin: 8px 0 16px; }
.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 48ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.hero-card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: 28px;
  padding: 22px; box-shadow: var(--shadow); transform: rotate(1.2deg);
}
.phone-frame {
  border: 1px solid var(--line); border-radius: 28px; padding: 16px; background: #121826; color: #f4efe6;
}
.phone-frame small { opacity: .7; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #7dcea0; display: inline-block; margin-right: 6px; }

.section { padding: 56px 0; }
.section h2 { font-size: clamp(28px, 4vw, 42px); margin: 0 0 24px; }
.grid-3, .grid-2, .grid-4 { display: grid; gap: 18px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.card {
  background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: 0 1px 0 rgba(255,255,255,.8) inset;
}
.card h3 { margin-top: 0; }
.step-no { font-family: var(--display); color: var(--teal); font-size: 28px; margin: 0; }
.muted { color: var(--ink-soft); }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 48px; color: var(--ink-soft); }
.footer-grid { display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.footer-grid a { color: inherit; margin-right: 12px; }

.auth-shell { min-height: calc(100vh - 72px); display: grid; place-items: center; padding: 32px 16px; }
.auth-card { width: min(460px, 100%); }
.form { display: grid; gap: 14px; }
label { font-weight: 650; font-size: 14px; display: grid; gap: 6px; }
input, select, textarea {
  font: inherit; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line);
  background: #fff; color: var(--ink); width: 100%;
}
textarea { min-height: 120px; resize: vertical; }
.help { font-size: 13px; color: var(--ink-soft); font-weight: 400; }
.consent { display: flex; gap: 10px; align-items: flex-start; font-weight: 500; }
.consent input { width: auto; margin-top: 4px; }
.honeypot { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.alert { padding: 12px 14px; border-radius: 12px; }
.alert-error { background: var(--danger-soft); color: var(--danger); }
.alert-ok { background: var(--ok-soft); color: var(--ok); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-info { background: var(--teal-soft); color: var(--teal-dark); }

.progress { display: flex; gap: 8px; overflow: auto; padding-bottom: 8px; }
.progress-item { min-width: 120px; font-size: 13px; color: var(--ink-soft); }
.progress-item b { display: block; height: 6px; background: var(--line); border-radius: 99px; margin-bottom: 8px; }
.progress-item.active b, .progress-item.done b { background: var(--teal); }
.progress-item.active { color: var(--ink); font-weight: 700; }

.dropzone {
  border: 1.5px dashed var(--teal); border-radius: 16px; padding: 28px; text-align: center;
  background: var(--teal-soft); cursor: pointer;
}
.dropzone.drag { background: #c7e8e4; }
.preview-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin-top: 16px; }
.preview-card img, .preview-card video { width: 100%; height: 120px; object-fit: cover; border-radius: 12px; background: #111; }
.badge { display: inline-flex; border-radius: 999px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-info { background: var(--teal-soft); color: var(--teal-dark); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-muted { background: #eee; color: var(--ink-soft); }

.camera-wrap { position: relative; background: #111; border-radius: 24px; overflow: hidden; aspect-ratio: 3/4; max-width: 420px; margin: 0 auto; }
.camera-wrap video, .camera-wrap canvas { width: 100%; height: 100%; object-fit: cover; }
.face-guide {
  position: absolute; inset: 12% 18%; border: 3px solid rgba(255,255,255,.85);
  border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 2000px rgba(0,0,0,.35);
}
.camera-actions { display: flex; gap: 10px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.progress-bar { height: 8px; background: var(--line); border-radius: 99px; overflow: hidden; }
.progress-bar > span { display: block; height: 100%; background: var(--teal); width: 0; }

.app-shell { display: grid; grid-template-columns: 240px 1fr; min-height: calc(100vh - 72px); }
.side {
  border-right: 1px solid var(--line); padding: 20px 14px; background: rgba(255,253,248,.6);
}
.side a { display: block; text-decoration: none; color: var(--ink-soft); padding: 10px 12px; border-radius: 12px; }
.side a.active, .side a:hover { background: #fff; color: var(--ink); }
.main { padding: 28px 22px 64px; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px; }
.stat b { font-family: var(--display); font-size: 28px; display: block; }
table { width: 100%; border-collapse: collapse; background: #fff; border-radius: 16px; overflow: hidden; }
th, td { text-align: left; padding: 12px 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
th { background: #faf7f1; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 16px; }

.admin-body { background: #eef1f4; }
.admin-header { background: #152033; color: #f4efe6; }
.admin-header .brand, .admin-header a { color: #f4efe6; }
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: calc(100vh - 64px); }
.admin-side { background: #1c2b44; color: #d7deea; padding: 18px 12px; }
.admin-side a { color: inherit; display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.admin-side a.active, .admin-side a:hover { background: rgba(255,255,255,.08); color: #fff; }
.doc-frame { width: 100%; min-height: 280px; border: 1px solid var(--line); border-radius: 12px; background: #111; }

.notice { position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 560px; margin: auto; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); display: none; }
.notice.show { display: block; }
.cookie-banner {
  position: sticky; bottom: 0; z-index: 40;
  background: #fffdf8; border-top: 1px solid var(--line); padding: 18px 0;
  box-shadow: 0 -12px 40px rgba(21,32,51,.08);
}
.cookie-banner h2 { margin: 0 0 8px; font-size: 22px; }
.cookie-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 12px; }
.legal-doc h2 { margin-top: 2rem; font-size: 1.35rem; }
.legal-doc ul { margin: 0 0 1rem; padding-left: 1.2rem; }
.legal-doc li { margin: 0.2rem 0; }

@media (max-width: 900px) {
  .hero, .grid-3, .grid-2, .grid-4, .app-shell, .admin-shell, .stat-grid { grid-template-columns: 1fr; }
  .hero { padding-top: 28px; }
  .side, .admin-side { display: flex; gap: 8px; overflow: auto; border: 0; }
  .side a, .admin-side a { white-space: nowrap; }
}
