/* Ascenti - Warranty Check (2026-11) */
:root {
  --bg: #F5F6F8;
  --surface: #FFFFFF;
  --ink: #1C2430;
  --muted: #55607A;
  --line: #E6E8EE;
  --track: #EEF0F4;
  --accent: #40609A;
  --accent-dark: #334E80;
  --accent-soft: #E8EDF6;
  --ok: #0A6B3F;
  --ok-bg: #DDF5E7;
  --ok-ink: #075A34;
  --bad: #A3231B;
  --bad-bg: #FDE3E0;
  --bad-ink: #8A1A14;
  --warn-bg: #FFEBCC;
  --warn-ink: #6B3C00;
  --hero: linear-gradient(115deg, #34425F 0%, #46587F 30%, #6078A6 50%, #46587F 70%, #34425F 100%);
  --shadow: 0 24px 48px -28px rgba(59, 74, 107, 0.35), 0 1px 2px rgba(28, 36, 48, 0.06);
  --font: 'Anuphan', 'Noto Sans Thai', 'Leelawadee UI', Tahoma, sans-serif;
  --mono: 'Space Mono', 'Consolas', monospace;
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
}

a { color: var(--accent); }
a:hover { color: var(--accent-dark); }

a:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid #9DB4DD;
  outline-offset: 2px;
}

svg {
  width: 20px;
  height: 20px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

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

/* ---------- ส่วนหัว ---------- */
.hero {
  background: #46587F;
  background: var(--hero);
  color: #FFFFFF;
  border-radius: 0 0 32px 32px;
  padding: 16px 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}

.hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.hero-logo { display: flex; align-items: center; min-height: 44px; }
.hero-logo img { display: block; height: 56px; width: auto; }

.hero-nav { display: flex; align-items: center; gap: 8px; }
.hero-nav a {
  width: 44px;
  height: 44px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.14);
  color: #FFFFFF;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.hero-nav a:hover { background: rgba(255, 255, 255, 0.24); color: #FFFFFF; }
.hero-nav span { display: none; }

.hero-body { display: flex; flex-direction: column; gap: 6px; }

.hero h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.hero-sub { margin: 0; font-size: 17px; line-height: 1.5; color: #E3E8F3; }

.search { margin: 12px 0 0; display: flex; flex-direction: column; gap: 8px; width: 100%; }
.search label { font-size: 14px; font-weight: 600; }

.search-box {
  display: flex;
  align-items: center;
  gap: 4px;
  height: 60px;
  padding: 0 6px 0 20px;
  border-radius: 30px;
  background: #FFFFFF;
}

.search-box input {
  flex: 1 1 0;
  min-width: 0;
  height: 48px;
  border: 0;
  background: transparent;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 18px;
  font-weight: 700;
}
.search-box input::placeholder { font-family: var(--font); font-size: 15px; font-weight: 400; color: #6B7488; }
.search-box input:focus { outline: none; }
.search-box:focus-within { box-shadow: 0 0 0 3px #9DB4DD; }

.search-box button {
  width: 48px;
  height: 48px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.search-box button:hover { background: var(--accent-dark); }
.search-box button svg { width: 22px; height: 22px; stroke-width: 2.4; }
.search-box button span { display: none; }

/* ---------- เนื้อหา ---------- */
main {
  display: flex;
  flex-direction: column;
  gap: 22px;
  padding: 24px 20px 0;
}

.row { display: flex; flex-direction: column; gap: 22px; }

.card { background: var(--surface); border-radius: 28px; }

h2 { margin: 0; font-size: 17px; line-height: 1.4; font-weight: 700; }

/* บัตรผลลัพธ์ */
.result { display: flex; flex-direction: column; box-shadow: var(--shadow); }

.result-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
  padding: 24px 24px 26px;
}

.result-sn {
  margin: 0;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  overflow-wrap: anywhere;
}

dl, dd { margin: 0; }
dt { font-size: 13px; line-height: 1.4; color: var(--muted); }

.result-name { display: flex; flex-direction: column; gap: 4px; }
.result-name dd { font-size: 24px; line-height: 1.25; font-weight: 700; letter-spacing: -0.01em; overflow-wrap: anywhere; }

.pill {
  margin: 0;
  min-height: 40px;
  padding: 6px 16px 6px 12px;
  border-radius: 20px;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.3;
  display: flex;
  align-items: center;
  gap: 8px;
}
.pill svg { stroke-width: 2.6; }
.pill-ok { background: var(--ok-bg); color: var(--ok-ink); }
.pill-bad { background: var(--bad-bg); color: var(--bad-ink); }
.pill-warn { background: var(--warn-bg); color: var(--warn-ink); }

.result-body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin: 0 24px;
  padding: 24px 0;
  border-top: 2px dashed #C5CAD6;
}

.result-text { margin: 0; }

.fields { display: grid; grid-template-columns: 1fr; gap: 18px 16px; }
.fields > div { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.fields dd { font-size: 16px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.mono { font-family: var(--mono); }
.is-ok { color: var(--ok); }
.is-bad { color: var(--bad); }

.repair { display: flex; flex-direction: column; gap: 8px; }
.repair-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 10px; }
.repair-label { font-size: 13px; line-height: 1.4; color: var(--muted); }
.repair-value { font-size: 14px; font-weight: 700; }

.tabs {
  margin: 0;
  padding: 4px;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  border-radius: 26px;
  background: var(--track);
}
.tabs li {
  min-height: 52px;
  padding: 4px 8px;
  border-radius: 22px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.35;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
}
.tabs li.is-on {
  background: #FFFFFF;
  color: var(--accent-dark);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(28, 36, 48, 0.18);
}

.actions {
  margin-top: auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.btn {
  min-height: 50px;
  padding: 6px 8px;
  white-space: nowrap;
  border-radius: 25px;
  text-decoration: none;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
@media (max-width: 359px) { .btn { white-space: normal; } }
.btn-primary { background: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-dark); color: #FFFFFF; }
.btn-soft { background: var(--accent-soft); color: var(--accent-dark); }
.btn-soft:hover { background: #DCE4F2; color: var(--accent-dark); }

/* รายการมีไอคอนนำหน้า */
.bullets { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 14px; }
.bullets li { display: flex; align-items: flex-start; gap: 10px; font-size: 14.5px; line-height: 1.6; }
.bullets svg { margin-top: 2px; color: var(--accent); }
.bullets span { min-width: 0; overflow-wrap: anywhere; }

/* ข้อควรรู้ */
.notes { display: flex; flex-direction: column; gap: 16px; padding: 20px; }
.notes-contact { margin: 0; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14.5px; line-height: 1.6; overflow-wrap: anywhere; }
.actions-inline { margin-top: 0; display: flex; flex-wrap: wrap; }
.actions-inline .btn { min-height: 48px; padding: 6px 20px; }

/* ลิงก์ข้อมูลเพิ่มเติม */
.links { display: flex; flex-direction: column; background: var(--surface); border-radius: 28px; overflow: hidden; }
.links a {
  min-height: 58px;
  padding: 8px 20px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
}
.links a:last-child { border-bottom: 0; }
.links a:hover { background: #FAFBFC; }
.links a > svg { width: 18px; height: 18px; color: var(--muted); }
.links-th::before { content: "["; }
.links-th::after { content: "]"; }

.foot { margin-top: auto; padding: 24px 20px; text-align: center; font-size: 13px; color: var(--muted); }

/* ---------- จอกว้าง (แท็บเล็ตแนวนอน / คอม) ---------- */
@media (min-width: 900px) {
  .page {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 40px 0;
  }

  .hero { border-radius: 36px; padding: 20px 40px 40px; gap: 28px; }
  .hero-logo img { height: 72px; }
  .hero-nav a { width: auto; padding: 0 16px; }
  .hero-nav span { display: inline; }

  .hero-body { align-items: center; text-align: center; }
  .hero h1 { font-size: 64px; }
  .search { max-width: 640px; text-align: left; }
  .search-box button { width: auto; padding: 0 24px; }
  .search-box button svg { width: 20px; height: 20px; }
  .search-box button span { display: inline; }

  main { gap: 24px; padding: 32px 0 0; }

  .row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; align-items: stretch; }
  .row-single { grid-template-columns: minmax(0, 1fr); }

  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .links { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; background: none; border-radius: 0; overflow: visible; }
  .links a { min-height: 76px; padding: 16px 20px; border-radius: 20px; border-bottom: 0; background: var(--surface); }
  .links a:hover { background: #FFFFFF; box-shadow: var(--shadow); }
  .links-text { display: flex; flex-direction: column; gap: 2px; }
  .links-en { font-weight: 700; }
  .links-th { font-size: 14px; font-weight: 400; color: var(--muted); }
  .links-th::before, .links-th::after { content: none; }
}

@media (prefers-reduced-motion: no-preference) {
  .btn, .search-box button, .hero-nav a, .links a { transition: background-color 0.15s ease, box-shadow 0.15s ease; }
}
