:root {
  --red: #d60000;
  --red-dark: #b80000;
  --navy: #1f3a5f;
  --bg: #f4f5f7;
  --border: #e6e6e6;
  --shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  --radius: 16px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: 'Roboto', Arial, sans-serif;
  background: var(--bg);
  color: #222;
}

a {
  color: inherit;
}

/* ---------- Header ---------- */
.header {
  background: var(--red);
  color: #fff;
  padding: 16px;
  text-align: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .3px;
  position: sticky;
  top: 0;
  z-index: 10;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .15);
}

/* ---------- Layout ---------- */
.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  display: flex;
  justify-content: center;
  padding: 28px 16px;
}

.container {
  width: 100%;
}

@media (min-width: 640px) {
  .container {
    max-width: 460px;
    margin: 0 auto;
  }
}

/* ---------- Card ---------- */
.card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 24px;
  width: 100%;
}

.brand-logo {
  display: block;
  margin: 0 auto 18px;
  max-width: 160px;
  height: auto;
}

.title {
  text-align: center;
  font-size: 19px;
  font-weight: 700;
  color: var(--navy);
  margin: 0 0 4px;
}

.subtitle {
  text-align: center;
  font-size: 13px;
  color: #888;
  margin: 0 0 24px;
}

/* ---------- Form ---------- */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  margin-bottom: 6px;
}

.input {
  width: 100%;
  padding: 13px 14px;
  font-size: 15px;
  font-family: inherit;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  background: #fafafa;
  transition: border-color .15s, background .15s, box-shadow .15s;
}

.input:focus {
  outline: none;
  border-color: var(--red);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(214, 0, 0, .08);
}

/* ---------- Buttons ---------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 13px 16px;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  border-radius: 10px;
  border: none;
  cursor: pointer;
  text-decoration: none;
}

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

.btn-primary:hover {
  background: var(--red-dark);
}

.btn-outline {
  background: #fff;
  color: var(--navy);
  border: 1.5px solid var(--border);
}

.btn-outline:hover {
  border-color: var(--red);
  color: var(--red);
}

.divider {
  display: flex;
  align-items: center;
  text-align: center;
  color: #aaa;
  font-size: 12px;
  margin: 20px 0;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  border-bottom: 1px solid var(--border);
}

.divider span {
  padding: 0 10px;
}

/* ---------- Footer ---------- */
.footer {
  text-align: center;
  font-size: 11px;
  color: #aaa;
  padding: 18px;
}

/* ---------- Scan page ---------- */
.scanner-wrap {
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #000;
}

#reader {
  width: 100%;
}

.hint {
  text-align: center;
  font-size: 13px;
  color: #777;
  margin: 16px 0;
}

.error-box {
  display: none;
  background: #fdecea;
  color: var(--red);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  border-radius: 8px;
  margin-top: 16px;
  text-align: center;
}

.error-box.show {
  display: block;
}

/* ---------- Result page (verify.html) ---------- */
.result-logo {
  text-align: center;
  margin-bottom: 6px;
}

.result-logo img {
  width: 220px;
  max-width: 70%;
}

.status {
  text-align: center;
  color: var(--red);
  font-size: 32px;
  font-weight: 700;
  margin: 6px 0 12px;
}

.desc {
  text-align: center;
  font-size: 14px;
  color: var(--navy);
  font-weight: 500;
  line-height: 1.5;
  margin-bottom: 18px;
}

.pin-title {
  text-align: center;
  font-size: 13px;
  color: #888;
  font-weight: 500;
}

.pin {
  text-align: center;
  color: var(--navy);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 3px;
  margin: 6px 0 14px;
}

.info-text {
  text-align: center;
  font-size: 13px;
  color: #888;
  margin: 4px 0;
}

.section {
  margin-top: 26px;
  text-align: left;
}

.section-title {
  display: flex;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
  color: var(--navy);
  margin-bottom: 12px;
  text-transform: uppercase;
  letter-spacing: .4px;
}

.section-title::before {
  content: "";
  width: 24px;
  height: 3px;
  background: var(--red);
  margin-right: 10px;
  border-radius: 2px;
}

.table {
  width: 100%;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  background: #f7f7f8;
  margin-bottom: 8px;
  border-radius: 8px;
}

.row:last-child {
  margin-bottom: 0;
}

.label {
  font-size: 13px;
  color: #888;
  font-weight: 500;
}

.value {
  font-size: 13px;
  color: #222;
  font-weight: 600;
  text-align: right;
}

.loading {
  text-align: center;
  padding: 60px 0;
}

.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid #eee;
  border-top: 3px solid var(--red);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
  margin: 0 auto;
}

.loading-text {
  margin-top: 12px;
  font-size: 13px;
  color: #999;
}

@keyframes spin {
  100% {
    transform: rotate(360deg);
  }
}
