:root {
  --ink: #0b2036;
  --muted: #5d7085;
  --line: #dce5ee;
  --paper: #f4f7fa;
  --card: #ffffff;
  --navy: #0b2a4a;
  --teal: #0d8a83;
  --teal-dark: #086a65;
  --danger: #b42318;
  --ok: #087443;
  --shadow: 0 18px 50px rgba(11, 32, 54, 0.09);
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 8% 0%, rgba(13, 138, 131, 0.12), transparent 28rem),
    radial-gradient(circle at 100% 12%, rgba(11, 42, 74, 0.08), transparent 32rem),
    var(--paper);
  font-family: system-ui, -apple-system, "Segoe UI", Tahoma, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px 10px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand img {
  width: 76px;
  height: auto;
  display: block;
}

.brand strong {
  display: block;
  font-size: 18px;
  letter-spacing: 0.22em;
  line-height: 1;
  color: var(--navy);
}

.brand span {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  white-space: nowrap;
}

.wrap {
  max-width: 1120px;
  margin: 0 auto;
  padding: 22px 24px 64px;
}

.hero {
  max-width: 720px;
  margin: 12px 0 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--teal-dark);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.hero h1 {
  margin: 0;
  color: var(--navy);
  font-size: clamp(30px, 5vw, 50px);
  line-height: 1.15;
  letter-spacing: -0.035em;
}

.hero p:not(.eyebrow) {
  max-width: 620px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

.card {
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--card);
  box-shadow: var(--shadow);
}

.card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 20px;
  color: var(--navy);
  font-size: 17px;
}

.card h2 span {
  display: inline-grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 9px;
  color: #fff;
  background: var(--navy);
  font-size: 12px;
}

.drop {
  position: relative;
  border: 1.5px dashed #b9c9d9;
  border-radius: 16px;
  background: #f8fbfd;
  transition: border-color 160ms ease, background 160ms ease;
}

.drop:hover,
.drop.dragover {
  border-color: var(--teal);
  background: #f0fbfa;
}

.drop-label {
  display: flex;
  min-height: 170px;
  padding: 22px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  color: var(--muted);
  text-align: center;
  cursor: pointer;
}

.drop-label strong {
  color: var(--ink);
  font-size: 15px;
}

.drop-label span:not(.drop-icon) {
  font-size: 13px;
}

.drop-label small {
  margin-top: 3px;
  color: #8a9aac;
  font-size: 11px;
}

.drop-icon {
  display: grid;
  width: 42px;
  height: 42px;
  margin-bottom: 3px;
  place-items: center;
  border-radius: 13px;
  color: var(--teal-dark);
  background: #e3f5f3;
  font-size: 24px;
  line-height: 1;
}

.file-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 14px 14px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #e9f7f5;
  color: var(--teal-dark);
  font-size: 12px;
}

.link {
  padding: 0;
  border: 0;
  color: var(--teal-dark);
  background: transparent;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

.or {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: #8a9aac;
  font-size: 12px;
}

.or::before,
.or::after {
  content: "";
  height: 1px;
  flex: 1;
  background: var(--line);
}

.field-label {
  display: block;
  margin-bottom: 7px;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
}

textarea {
  width: 100%;
  min-height: 86px;
  resize: vertical;
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  outline: 0;
  color: var(--ink);
  background: #fbfdff;
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 3px rgba(13, 138, 131, 0.12);
}

.primary,
.secondary {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background 160ms ease, opacity 160ms ease;
}

.primary {
  width: 100%;
  margin-top: 16px;
  border: 0;
  color: #fff;
  background: var(--navy);
}

.primary:hover { background: #113c67; }
.primary:active, .secondary:active { transform: translateY(1px); }
.primary:disabled { opacity: 0.55; cursor: wait; }

.secondary {
  padding: 0 18px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: #fff;
}

.secondary:hover { background: #f2f8fa; }

.status {
  min-height: 20px;
  margin: 12px 0 0;
  font-size: 13px;
  line-height: 1.6;
}

.status.error { color: var(--danger); }
.status.ok { color: var(--ok); }

.privacy {
  margin: 10px 0 0;
  color: #8a9aac;
  font-size: 11px;
  line-height: 1.7;
}

.result {
  border-color: #c9e5e1;
}

.print-area {
  display: flex;
  padding: 18px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  background: #fff;
  border: 1px solid #edf2f6;
}

.print-area img {
  display: block;
  width: min(100%, 380px);
  height: auto;
}

.print-caption {
  margin-top: 10px;
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.verified {
  margin: 14px 0;
  color: var(--ok);
  font-size: 12px;
  line-height: 1.6;
  text-align: center;
}

.actions {
  display: flex;
  gap: 10px;
}

.actions .primary {
  margin: 0;
}

.actions .secondary {
  flex: 0 0 auto;
}

.again {
  display: block;
  margin: 16px auto 0;
}

footer {
  display: flex;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px 28px;
  justify-content: space-between;
  gap: 18px;
  color: #8a9aac;
  font-size: 11px;
}

[hidden] { display: none !important; }

@media (max-width: 760px) {
  .topbar { padding: 18px 16px 4px; }
  .wrap { padding: 18px 16px 44px; }
  .grid { grid-template-columns: 1fr; }
  .card { padding: 20px; border-radius: 18px; }
  .hero { margin: 10px 0 22px; }
  .hero p:not(.eyebrow) { font-size: 14px; }
  .badge { font-size: 10px; }
  footer { padding: 0 16px 24px; flex-direction: column; }
}

@media print {
  @page { margin: 12mm; }

  body {
    background: #fff !important;
    color: #000;
  }

  .topbar,
  .hero,
  footer,
  .card:not(#result),
  .verified,
  .actions,
  .again {
    display: none !important;
  }

  .wrap {
    max-width: none;
    padding: 0;
    margin: 0;
  }

  .grid {
    display: block;
  }

  .card#result {
    display: block !important;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .card#result h2 { display: none; }

  .print-area {
    padding: 0;
    border: 0;
    background: #fff;
  }

  .print-area img {
    width: 15cm;
    max-width: 100%;
    height: auto;
    margin: 0 auto;
  }

  .print-caption {
    margin-top: 4mm;
    color: #000;
    font-size: 11pt;
  }
}
