:root {
  --blue: #214f98;
  --blue-dark: #173b74;
  --blue-soft: #eaf2ff;
  --green: #16834a;
  --green-soft: #e8f8ef;
  --red: #bf2f38;
  --red-soft: #fff0f1;
  --ink: #172033;
  --muted: #65708a;
  --line: #dfe5ef;
  --bg: #f5f7fb;
  --card: #ffffff;
  --shadow: 0 12px 34px rgba(25, 52, 96, .10);
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  min-height: 100%;
  font-family: Arial, Helvetica, sans-serif;
  background: var(--bg);
  color: var(--ink);
}

body {
  padding-bottom: 32px;
}

a {
  color: inherit;
  text-decoration: none;
}

.topbar {
  background: linear-gradient(135deg, var(--blue-dark), var(--blue));
  color: #fff;
  padding: 18px 18px 22px;
  box-shadow: 0 3px 12px rgba(10, 30, 69, .17);
}

.topbar-inner,
.page {
  width: min(100%, 920px);
  margin: 0 auto;
}

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  font-size: 22px;
  background: rgba(255,255,255,.16);
  border: 1px solid rgba(255,255,255,.22);
}

.brand-title {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .1px;
}

.brand-subtitle {
  margin-top: 3px;
  font-size: 12px;
  opacity: .82;
}

.page {
  padding: 22px 16px 0;
}

.hero {
  margin: 8px 0 22px;
}

.hero h1 {
  margin: 0 0 8px;
  font-size: clamp(24px, 6vw, 34px);
  line-height: 1.15;
}

.hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.card-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: 1fr;
}

.action-card,
.panel {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.action-card {
  display: block;
  padding: 20px;
  transition: transform .18s ease, box-shadow .18s ease;
}

.action-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(25, 52, 96, .15);
}

.card-icon {
  width: 50px;
  height: 50px;
  display: grid;
  place-items: center;
  border-radius: 15px;
  font-size: 25px;
  background: var(--blue-soft);
}

.card-title {
  margin: 16px 0 6px;
  font-size: 19px;
  font-weight: 800;
}

.card-text {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
  font-size: 14px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 14px;
  padding: 7px 10px;
  border-radius: 99px;
  background: #f2f5fb;
  color: var(--blue-dark);
  font-size: 12px;
  font-weight: 700;
}

.panel {
  padding: 18px;
}

.panel + .panel {
  margin-top: 16px;
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 17px;
}

.panel h1,
.panel h2 {
  margin: 0;
}

.panel h1 {
  font-size: 24px;
}

.panel h2 {
  font-size: 17px;
}

.panel-note {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.back-link {
  display: inline-flex;
  margin-bottom: 16px;
  color: var(--blue);
  font-size: 14px;
  font-weight: 700;
}

.form-grid {
  display: grid;
  gap: 14px;
}

.form-grid.two {
  grid-template-columns: 1fr;
}

label {
  display: block;
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 800;
  color: #34415b;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid #cdd6e5;
  border-radius: 11px;
  outline: none;
  color: var(--ink);
  background: #fff;
}

input:focus,
select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(33, 79, 152, .12);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.btn {
  min-height: 46px;
  border: 0;
  border-radius: 11px;
  padding: 11px 15px;
  font-weight: 800;
  cursor: pointer;
  transition: opacity .16s ease, transform .16s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  opacity: .52;
  cursor: not-allowed;
  transform: none;
}

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

.btn-secondary {
  color: var(--blue-dark);
  background: var(--blue-soft);
}

.btn-success {
  color: #fff;
  background: var(--green);
}

.btn-danger {
  color: #fff;
  background: var(--red);
}

.camera-wrap {
  overflow: hidden;
  position: relative;
  border: 1px solid #ced8e8;
  border-radius: 16px;
  background: #0d1424;
  aspect-ratio: 3 / 4;
}

.camera-wrap video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scaleX(-1);
}

.camera-guide {
  position: absolute;
  inset: 11% 14%;
  border: 3px solid rgba(255,255,255,.88);
  border-radius: 49%;
  pointer-events: none;
  box-shadow: 0 0 0 999px rgba(0,0,0,.22);
}

.camera-caption {
  position: absolute;
  right: 10px;
  bottom: 10px;
  left: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  color: #fff;
  background: rgba(0,0,0,.58);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.samples {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
  margin-top: 12px;
}

.sample-box {
  overflow: hidden;
  position: relative;
  min-height: 76px;
  display: grid;
  place-items: center;
  border: 1px dashed #b4c2d8;
  border-radius: 10px;
  background: #f7faff;
  color: #77829a;
  font-size: 11px;
  text-align: center;
}

.sample-box img {
  width: 100%;
  height: 100%;
  min-height: 76px;
  object-fit: cover;
  transform: scaleX(-1);
}

.status-box {
  margin-top: 16px;
  padding: 13px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.45;
}

.status-info {
  color: #22477d;
  background: #edf4ff;
  border: 1px solid #c9dcfb;
}

.status-success {
  color: #116137;
  background: var(--green-soft);
  border: 1px solid #b6e8ca;
}

.status-error {
  color: #9d2630;
  background: var(--red-soft);
  border: 1px solid #ffc9cd;
}

.status-warning {
  color: #7a5200;
  background: #fff7df;
  border: 1px solid #f4dc99;
}

.hidden {
  display: none !important;
}

.location-result {
  display: grid;
  gap: 8px;
  margin-top: 15px;
}

.location-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #edf0f5;
  font-size: 14px;
}

.location-row:last-child {
  border-bottom: 0;
}

.location-row strong {
  text-align: right;
}

.success-screen {
  padding: 30px 16px;
  text-align: center;
}

.success-icon {
  width: 80px;
  height: 80px;
  display: grid;
  place-items: center;
  margin: 0 auto 16px;
  border-radius: 50%;
  color: #fff;
  background: var(--green);
  font-size: 39px;
  box-shadow: 0 10px 24px rgba(22,131,74,.28);
}

.success-screen h1 {
  margin: 0 0 10px;
  font-size: 24px;
}

.success-screen p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.success-time {
  margin: 19px 0;
  color: var(--ink);
  font-size: 30px;
  font-weight: 900;
}

.small-muted {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

@media (min-width: 660px) {
  .topbar {
    padding: 22px 24px 26px;
  }

  .page {
    padding-top: 28px;
  }

  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .form-grid.two {
    grid-template-columns: repeat(2, 1fr);
  }

  .panel {
    padding: 24px;
  }

  .camera-wrap {
    max-width: 430px;
    margin: 0 auto;
  }
}
