/* ============================================================
   Đổi địa chỉ cũ → mới · tone màu theo visalienminh.vn
   Navy + vàng gold + đỏ. Màu = thông tin: cũ → đỏ, mới → navy.
   ============================================================ */

:root {
  --ink: #111418;
  --ink-soft: #444c66;
  --ink-faint: #8b93a8;
  --paper: #f6f8fc;
  --paper-raise: #ffffff;
  --line: #dfe3ec;
  --line-soft: #eef0f6;
  --seal: #e31b23;      /* đỏ — địa chỉ cũ, dấu mốc (theme visalienminh) */
  --seal-tint: #fde7e8;
  --survey: #000a5e;    /* navy — địa chỉ mới, hành động chính */
  --survey-tint: #e6e8f2;
  --survey-deep: #000740;
  --gold: #f9d423;      /* vàng gold — nhấn */
  --gold-deep: #b8860b; /* gold đậm cho chữ/nét trên nền sáng */
  --gold-tint: #fdf6d6;

  --sans: "Be Vietnam Pro", system-ui, sans-serif;
  --display: "Bricolage Grotesque", var(--sans);
  --mono: "DM Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

/* Lưới tọa độ mờ gợi bản đồ khảo sát — chi tiết chữ ký của trang. */
.graticule {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(var(--line-soft) 1px, transparent 1px),
    linear-gradient(90deg, var(--line-soft) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(circle at 50% 22%, #000 0%, transparent 78%);
          mask-image: radial-gradient(circle at 50% 22%, #000 0%, transparent 78%);
  opacity: 0.55;
}

.wrap {
  position: relative;
  z-index: 1;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(2rem, 6vw, 4.5rem) clamp(1.1rem, 4vw, 2rem) 3rem;
}

/* ---------- Masthead ---------- */
.eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--seal);
  margin: 0 0 1.1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}
.eyebrow::before {
  content: "";
  width: 9px; height: 9px;
  border: 2px solid var(--seal);
  border-radius: 50%;
  display: inline-block;
}

.title {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(2.3rem, 7vw, 3.7rem);
  line-height: 1.02;
  letter-spacing: -0.02em;
  margin: 0 0 1.1rem;
}

.lede {
  font-size: clamp(1rem, 2.4vw, 1.15rem);
  color: var(--ink-soft);
  max-width: 42ch;
  margin: 0 0 2rem;
}
.lede em { font-style: normal; font-weight: 600; color: var(--ink); }

.ledger {
  display: flex;
  flex-wrap: wrap;
  gap: 0 2.4rem;
  margin: 0 0 2.6rem;
  padding: 1rem 0 0;
  border-top: 1px solid var(--line);
}
.ledger div { padding: 0.2rem 0; }
.ledger dt {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.15rem;
}
.ledger dd {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.5rem;
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
}
.ledger .was { color: var(--seal); text-decoration: line-through; text-decoration-thickness: 2px; }
.ledger .arw { color: var(--ink-faint); font-size: 1rem; }
.ledger .now { color: var(--survey); }
.ledger .removed { color: var(--seal); font-size: 1.2rem; }

/* ---------- Công cụ ---------- */
.tool {
  background: var(--paper-raise);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: clamp(1.2rem, 3.5vw, 1.9rem);
  box-shadow: 0 1px 0 #fff inset, 0 18px 40px -28px rgba(27, 36, 48, 0.4);
}

.fields { display: grid; gap: 1.05rem; }

.field { display: flex; flex-direction: column; gap: 0.4rem; }

.field label {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--ink);
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.tag {
  font-family: var(--mono);
  font-size: 0.6rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--seal);
  background: var(--seal-tint);
  padding: 0.12rem 0.4rem;
  border-radius: 4px;
}
.tag--opt { color: var(--ink-faint); background: var(--line-soft); }

select, input[type="text"] {
  font-family: var(--sans);
  font-size: 1rem;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.7rem 0.85rem;
  width: 100%;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2355606e' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.2rem;
  cursor: pointer;
}
select:disabled { color: var(--ink-faint); cursor: not-allowed; opacity: 0.7; }
select:focus-visible, input:focus-visible {
  outline: none;
  border-color: var(--survey);
  box-shadow: 0 0 0 3px var(--survey-tint);
}

/* ---------- Combobox gõ-để-lọc ---------- */
.combo { position: relative; }
.combo-input {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2355606e' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.2rem;
}
.combo-input:disabled { color: var(--ink-faint); cursor: not-allowed; opacity: 0.7; }
.combo-list {
  position: absolute;
  z-index: 6;
  top: calc(100% + 5px);
  left: 0; right: 0;
  max-height: 264px;
  overflow-y: auto;
  margin: 0;
  padding: 5px;
  list-style: none;
  background: var(--paper-raise);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 34px -20px rgba(27, 36, 48, 0.45);
}
.combo-opt {
  padding: 0.5rem 0.6rem;
  border-radius: 7px;
  cursor: pointer;
  font-size: 0.96rem;
  line-height: 1.35;
}
.combo-opt[aria-selected="true"] { background: var(--survey-tint); color: var(--survey-deep); }
.combo-empty { padding: 0.55rem 0.6rem; color: var(--ink-faint); font-size: 0.9rem; }

.status {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: var(--ink-soft);
  min-height: 1.2em;
}
.status.err { color: var(--seal); font-weight: 500; }

/* ---------- Kết quả: thẻ công báo ---------- */
.result { margin-top: 1.6rem; }

.result-card {
  background: var(--paper-raise);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

/* Địa chỉ cũ — mực đỏ, cấp huyện gạch bỏ */
.addr-old {
  padding: 1.15rem 1.3rem;
  border-bottom: 1px dashed var(--line);
  position: relative;
}
.addr-role {
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 0.5rem;
}
.addr-old .addr-role { color: var(--seal); }
.addr-old p { margin: 0; font-size: 1.05rem; line-height: 1.5; }
.strike {
  color: var(--ink-faint);
  text-decoration: line-through;
  text-decoration-color: var(--seal);
  text-decoration-thickness: 2px;
}
.strike-note {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: var(--seal);
  margin-left: 0.4rem;
  vertical-align: 0.1em;
}

.transition {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 1.3rem;
  background: var(--paper);
  color: var(--ink-faint);
  font-family: var(--mono);
  font-size: 0.66rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.transition::before, .transition::after {
  content: ""; height: 1px; background: var(--line); flex: 1;
}

/* Địa chỉ mới — xanh địa chính */
.addr-new { padding: 1.15rem 1.3rem 1.3rem; }
.addr-new .addr-role { color: var(--survey); }

.note {
  display: flex;
  gap: 0.5rem;
  font-size: 0.86rem;
  color: var(--survey-deep);
  background: var(--survey-tint);
  border-radius: 8px;
  padding: 0.6rem 0.75rem;
  margin: 0 0 1rem;
}
.note::before { content: "❖"; color: var(--gold-deep); }

.option {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line-soft);
}
.option:first-of-type { border-top: none; }
.option-addr { font-size: 1.1rem; line-height: 1.45; font-weight: 500; }
.option-addr .marker { color: var(--survey); font-weight: 700; }
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.58rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--gold-deep);
  background: var(--gold-tint);
  border: 1px solid var(--gold-deep);
  border-radius: 4px;
  padding: 0.1rem 0.35rem;
  margin-left: 0.5rem;
  vertical-align: 0.15em;
}

.copy {
  flex: none;
  font-family: var(--sans);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--survey-deep);
  background: var(--paper-raise);
  border: 1px solid var(--survey);
  border-radius: 8px;
  padding: 0.45rem 0.7rem;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.copy:hover { background: var(--survey); color: #fff; }
.copy:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--survey-tint); }
.copy.done { background: var(--survey); color: #fff; border-color: var(--survey); }

/* ---------- Chân trang ---------- */
.foot {
  margin-top: 2.6rem;
  padding-top: 1.2rem;
  border-top: 1px solid var(--line);
  font-size: 0.8rem;
  color: var(--ink-faint);
}
.foot a { color: var(--seal); text-decoration: underline; text-underline-offset: 2px; }
.foot .disclaimer { margin-bottom: 0; }

/* ---------- Vào kết quả ---------- */
@media (prefers-reduced-motion: no-preference) {
  .result-card { animation: rise 0.28s ease-out; }
  @keyframes rise {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (min-width: 560px) {
  .fields { grid-template-columns: 1fr 1fr; }
  .field--street { grid-column: 1 / -1; }
}
