/* เงินไชโย รีไฟแนนซ์ v4 — layout จาก BU (phone single-column) */
[hidden]{display:none!important}
:root {
  --navy:      #000F9F;
  --brand:     #000F9F;
  --yellow:    #FFD100;
  --yellow-lt: #FFF8D6;
  --yellow-bdr:#E5B400;
  --navy-lt:   #EEEAFF;
  --g4: #BBB; --g5: #DEDEDE; --g6: #F0F0F0;
  --border:  #D4D4D4;
  --box:     #F5F5F5;
  --surface: #FFFFFF;
  --bg:      #E4E4E4;
  --text:    #1A1A1A;
  --text2:   #444;
  --text3:   #888;
  --good:    #2D6A4F;
  --good-bg: #D8F3DC;
  --result-bg: #F0EDFF;
}
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif;
  background: var(--bg);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 32px 0 80px;
}
@media (max-width: 440px) { body { padding: 0; background: var(--surface); } }

.phone {
  width: 390px;
  background: var(--surface);
  overflow: hidden;
  box-shadow: 0 12px 48px rgba(0,0,0,0.22), 0 2px 8px rgba(0,0,0,0.12);
  display: flex; flex-direction: column;
}
@media (min-width: 441px) { .phone { border-radius: 16px; min-height: 720px; } }

.wf-notice {
  padding: 7px 16px;
  background: var(--g6); border-bottom: 1px solid var(--border);
  font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums;
  font-size: 8px; color: var(--text3); letter-spacing: 0.04em; text-align: center;
}

/* AW BANNER */
.aw-banner {
  background: linear-gradient(110deg, #F5C400 0%, #FFD840 60%, #F5C400 100%);
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  border-bottom: 2px solid #D9AF00;
}
.aw-left { flex: 1; }
.aw-eyebrow { font-size: 10px; color: var(--navy); font-weight: 600; opacity: 0.75; letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 3px; }
.aw-headline { font-size: 20px; font-weight: 700; color: var(--navy); line-height: 1.15; margin-bottom: 4px; }
.aw-rate { font-size: 11px; color: var(--navy); opacity: 0.82; }
.aw-rate strong { font-size: 14px; font-weight: 700; opacity: 1; }
.aw-headline { font-size: 16px; font-weight: 800; color: var(--navy); line-height: 1.2; margin-bottom: 8px; }
.aw-bullets { display: flex; flex-direction: column; gap: 3px; }
.aw-bullet { font-size: 11px; font-weight: 600; color: var(--navy); line-height: 1.4; }
.aw-bullet strong { font-weight: 800; }
.aw-badge {
  background: var(--navy); border-radius: 50%;
  width: 66px; height: 66px; flex-shrink: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; box-shadow: 0 4px 12px rgba(0,15,159,0.35);
}
.aw-badge.red { background: #F5333F; box-shadow: 0 4px 12px rgba(245,51,63,0.4); }
.aw-badge-lbl { font-size: 7px; color: rgba(255,255,255,0.7); letter-spacing: 0.06em; text-transform: uppercase; margin-bottom: 2px; }
.aw-badge-date { font-size: 8.5px; font-weight: 700; color: #fff; line-height: 1.35; }
/* rate-pill extra */
.rate-promo { font-size: 10px; color: rgba(255,255,255,0.65); margin-top: 8px; font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .05em; }
/* extra result rows */
.sav-row-hi .sav-val { color: #C0392B; }
/* Section 5 redesign */
.s5-header { background: var(--yellow); padding: 14px 16px; display: flex; align-items: center; gap: 8px; }
.s5-header-title { font-size: 16px; font-weight: 800; color: var(--navy); }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 6px; }
.red-btn {
  width: 100%; height: 52px;
  background: #F5333F; color: #fff;
  border: none; border-radius: 8px;
  font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-size: 16px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(245,51,63,0.35);
  transition: opacity .15s, transform .1s; position: relative; overflow: hidden;
}
.red-btn:active { opacity: .85; transform: scale(.99); }
.red-btn.loading { pointer-events: none; }
.red-btn.loading .btn-text { opacity: 0; }
.red-btn.loading .spinner { display: block; border-top-color: #fff; border-color: rgba(255,255,255,0.25); border-top-color: #fff; }

/* SECTIONS */
.tbl-caption { font-size: 11.5px; font-weight: 600; color: var(--text2); margin: 12px 0 6px; }
.legal-block { margin-top: 10px; }
.legal-head { font-size: 12.5px; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.legal-body { font-size: 10.5px; line-height: 1.5; color: var(--text3); }
.aw-banner-img { display: block; width: 100%; height: auto; }
.rate-note { margin-top: 10px; font-size: 10px; line-height: 1.55; color: rgba(255,255,255,0.72);
  text-align: center; }
.privacy-line { padding: 10px 16px; font-size: 12px; color: var(--text2); background: var(--surface);
  border-bottom: 1px solid var(--border); }
.privacy-line a { color: var(--brand); font-weight: 600; text-decoration: underline; }
.section { padding: 18px 16px; border-bottom: 1px solid var(--border); background: var(--surface); }
.section.alt { background: var(--box); }
.sec-hdr {
  background: var(--g5); border-radius: 7px;
  padding: 10px 14px; font-size: 13px; font-weight: 700; color: var(--text);
  margin-bottom: 14px;
}
.sub-label { font-size: 11px; font-weight: 700; color: var(--text2); margin: 14px 0 8px; }

/* CAR TYPE CARDS */
.card-row { display: flex; gap: 8px; }
/* v14: marketing supplied 3D artwork for the two vehicle types, replacing the line icons */
.type-img { width: 62px; height: 62px; object-fit: contain; display: block; margin: 0 auto 2px; }
.type-card {
  flex: 1; background: var(--box); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 14px 8px 12px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  cursor: pointer; transition: background .18s, border-color .18s; user-select: none;
}
.type-card.selected { background: var(--navy); border-color: var(--navy); }
.type-card-label { font-size: 11px; font-weight: 700; color: var(--text2); }
.type-card.selected .type-card-label { color: #fff; }

/* CHECK OPTIONS */
.check-row { display: flex; gap: 8px; }
.check-opt {
  flex: 1; background: var(--surface); border: 1.5px solid var(--border);
  border-radius: 8px; padding: 10px 10px;
  display: flex; align-items: center; gap: 7px;
  cursor: pointer; transition: border-color .2s, background .2s; user-select: none;
}
.check-opt.sel { background: var(--navy-lt); border-color: var(--navy); }
.check-box {
  width: 18px; height: 18px; border: 1.5px solid var(--g4); border-radius: 4px;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  transition: background .2s, border-color .2s;
}
.check-opt.sel .check-box { background: var(--navy); border-color: var(--navy); }
.check-icon { display: none; }
.check-opt.sel .check-icon { display: block; }
.check-label { font-size: 11px; font-weight: 600; color: var(--text2); line-height: 1.3; }
.check-opt.sel .check-label { color: var(--navy); }

/* FIELDS */
.field-group { display: flex; flex-direction: column; gap: 12px; }
.field-item { display: flex; flex-direction: column; gap: 4px; }
.field-lbl { font-size: 11px; color: var(--text2); font-weight: 600; }
.field-lbl span { font-weight: 400; color: var(--text3); font-size: 10px; }
input[type="text"], input[type="number"], input[type="tel"], select {
  width: 100%; height: 44px; background: var(--surface);
  border: 1.5px solid var(--border); border-radius: 7px;
  padding: 0 12px; font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-size: 14px;
  color: var(--text); outline: none; appearance: none; -webkit-appearance: none;
  transition: border-color .18s, box-shadow .18s;
}
input[type="number"] { font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; }
input:focus, select:focus { border-color: var(--navy); box-shadow: 0 0 0 3px rgba(0,15,159,0.1); }
input::placeholder { color: var(--text3); font-size: 13px; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: ''; position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%) rotate(45deg);
  width: 7px; height: 7px;
  border-right: 2px solid var(--text3); border-bottom: 2px solid var(--text3);
  pointer-events: none;
}
select { padding-right: 36px; cursor: pointer; }

/* PERIOD PILLS */
.pill-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.pill {
  height: 48px; border: 1.5px solid var(--border); border-radius: 24px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  cursor: pointer; user-select: none; transition: all .18s;
}
.pill-num { font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; font-size: 15px; font-weight: 600; color: var(--text2); line-height: 1; }
.pill-unit { font-size: 9px; color: var(--text3); }
.pill.selected { background: var(--navy); border-color: var(--navy); }
.pill.selected .pill-num, .pill.selected .pill-unit { color: #fff; }

/* YELLOW BUTTON */
.btn-icon { width: 26px; height: 26px; object-fit: contain; vertical-align: -7px; margin-right: 8px; }
.yellow-btn {
  width: 100%; height: 52px;
  background: var(--yellow); color: var(--navy);
  border: none; border-radius: 8px;
  font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-size: 16px; font-weight: 700;
  cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: 0 4px 14px rgba(245,196,0,0.4);
  transition: opacity .15s, transform .1s; position: relative; overflow: hidden;
}
.yellow-btn:active { opacity: .85; transform: scale(.99); }
.yellow-btn.loading { pointer-events: none; }
.yellow-btn.loading .btn-text { opacity: 0; }
.yellow-btn.loading .spinner { display: block; }
.spinner {
  display: none; position: absolute;
  width: 20px; height: 20px;
  border: 2.5px solid rgba(0,15,159,0.2); border-top-color: var(--navy);
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn-note { text-align: center; font-size: 10px; color: var(--text3); margin-top: 8px; font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; }

/* SECTION 4: RESULTS */
#section4 { display: none; }
#section4.visible { display: block; }
.result-bg { background: var(--result-bg); border-top: 2px solid #C4B8FF; }
.result-hdr-wrap { padding: 14px 16px 0; }
.result-sec-hdr { background: #C4B8FF; border-radius: 7px; padding: 10px 14px; font-size: 13px; font-weight: 700; color: var(--navy); margin-bottom: 0; }

/* Rate hero */
.rate-hero {
  background: linear-gradient(140deg, #000F9F 0%, #1A2FC0 100%);
  padding: 26px 20px 22px; text-align: center; position: relative; overflow: hidden; margin-top: 14px;
}
.rate-hero::before {
  content: ''; position: absolute; top: -30px; right: -30px;
  width: 160px; height: 160px; border-radius: 50%;
  background: radial-gradient(circle, rgba(245,196,0,0.18) 0%, transparent 70%);
}
.rate-eyebrow { font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; font-size: 9px; color: rgba(255,255,255,0.5); letter-spacing: .1em; text-transform: uppercase; margin-bottom: 10px; }
.rate-numrow { display: flex; align-items: flex-start; justify-content: center; margin-bottom: 6px; }
.rate-num { font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; font-size: 88px; font-weight: 600; color: var(--yellow); line-height: 1; letter-spacing: -.03em; }
.rate-pct { font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 600; color: var(--yellow); margin-top: 8px; }
.rate-unit { font-size: 11px; color: rgba(255,255,255,0.5); margin-bottom: 10px; }
.rate-pill {
  display: inline-block; background: rgba(245,196,0,0.18);
  border: 1px solid rgba(245,196,0,0.35); border-radius: 20px;
  padding: 4px 14px; font-size: 10px; color: var(--yellow);
  font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .06em;
}

/* Result inner */
.result-inner { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; }

/* Compare */
.compare-lbl { font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; font-size: 8px; color: var(--text3); letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.compare-row { display: flex; gap: 8px; align-items: stretch; }
.cmp-box { flex: 1; border-radius: 8px; padding: 12px 14px; background: var(--surface); border: 1.5px solid var(--border); }
.cmp-box.cmp-new { background: var(--navy); border-color: var(--navy); }
.cmp-tag { font-size: 9px; color: var(--text3); margin-bottom: 5px; font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; }
.cmp-new .cmp-tag { color: rgba(255,255,255,0.45); }
.cmp-rate-val { font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 600; color: var(--text); line-height: 1; margin-bottom: 4px; }
.cmp-new .cmp-rate-val { color: var(--yellow); }
.cmp-mo { font-size: 11px; color: var(--text3); }
.cmp-new .cmp-mo { color: rgba(255,255,255,0.55); }
.cmp-term { font-size: 10.5px; opacity: .7; margin-top: 3px; letter-spacing: .01em; }
.cmp-arrow { display: flex; align-items: center; color: var(--text3); font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; flex-shrink: 0; padding: 0 2px; }

/* Savings rows */
.sav-rows { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.sav-row { display: flex; align-items: center; justify-content: space-between; padding: 11px 14px; border-bottom: 1px solid var(--border); }
.sav-row:last-child { border-bottom: none; }
.sav-lbl { font-size: 12px; color: var(--text2); }
.sav-val { font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; font-size: 14px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }

/* Mini stats */
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mini-box { background: var(--surface); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; }
.mini-lbl { font-size: 9px; color: var(--text3); font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 6px; }
.mini-val { font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; font-size: 20px; font-weight: 600; color: var(--text); line-height: 1; font-variant-numeric: tabular-nums; }
.mini-unit { font-size: 10px; color: var(--text3); margin-top: 3px; }

/* Table */
.table-wrap { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.table-head, .table-row { display: grid; grid-template-columns: 34px 1fr 1fr 1fr 52px; }
.table-head { background: var(--g6); border-bottom: 1px solid var(--border); }
.th, .td { padding: 8px; font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; font-size: 8.5px; font-variant-numeric: tabular-nums; }
.th { color: var(--text3); font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.td { color: var(--text2); font-size: 9px; }
.td.r, .th.r { text-align: right; }
.table-row { border-bottom: 1px solid var(--border); }
.table-row:last-child { border-bottom: none; }
.table-total { background: var(--g6); border-top: 1.5px solid var(--border); }
.table-total .td { font-weight: 700; color: var(--text); font-size: 9.5px; }
.table-footer { padding: 8px; text-align: center; font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; font-size: 8.5px; color: var(--text3); background: var(--box); border-top: 1px solid var(--border); cursor: pointer; letter-spacing: .06em; }

/* SECTION 5 */
#section5 { display: none; }
#section5.visible { display: block; }
.trust-strip { display: flex; gap: 6px; margin-bottom: 16px; }
.trust-pill { flex: 1; height: 30px; background: var(--box); border: 1px solid var(--border); border-radius: 20px; display: flex; align-items: center; justify-content: center; gap: 4px; }
.trust-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--text3); }
.trust-txt { font-size: 9px; color: var(--text3); font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.privacy-note { text-align: center; font-size: 10px; color: var(--text3); margin-top: 10px; font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; }

/* Success state */
#successState { display: none; }
#successState.visible {
  display: flex; flex-direction: column; align-items: center;
  text-align: center; padding: 40px 28px 52px;
  background: var(--navy-lt); border-top: 2px solid #C4B8FF;
}
.success-circle {
  width: 64px; height: 64px; background: var(--navy); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin-bottom: 20px;
  box-shadow: 0 6px 20px rgba(0,15,159,0.3);
}
.success-title { font-size: 20px; font-weight: 700; color: var(--navy); margin-bottom: 8px; }
.success-sub { font-size: 13px; color: var(--text2); line-height: 1.7; margin-bottom: 22px; max-width: 260px; }
.success-ref {
  font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-variant-numeric: tabular-nums; font-size: 10px; color: var(--text3);
  letter-spacing: .08em; margin-bottom: 28px;
  background: var(--surface); padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border);
}
.restart-btn {
  background: transparent; border: 1.5px solid var(--navy); border-radius: 8px;
  height: 44px; padding: 0 24px;
  font-family: 'NgernChaiyo_BETA4', 'Anuphan', sans-serif; font-size: 14px; font-weight: 600; color: var(--navy);
  cursor: pointer; transition: background .18s;
}
.restart-btn:hover { background: rgba(0,15,159,0.06); }

@keyframes slideUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
.anim { animation: slideUp 0.4s ease forwards; }
.hidden { display: none !important; }
/* revise#3 — header / banner / footer artwork with clickable hotspots */
.cy-art { position: relative; line-height: 0; }
.cy-art img { display: block; width: 100%; height: auto; }
.cy-art .hs { position: absolute; display: block; border-radius: 999px; }
.cy-art .hs:focus-visible { outline: 2px solid #FFD100; outline-offset: 1px; }
