/* ===================== Winsure — Design System ===================== */

@import url('https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600;700&family=Noto+Sans+Thai:wght@300;400;500;600;700&display=swap');

:root {
  --font: 'Prompt', 'Noto Sans Thai', sans-serif;

  --ink-900: #0f172a;
  --ink-700: #334155;
  --ink-500: #64748b;
  --ink-300: #cbd5e1;
  --ink-100: #f1f5f9;
  --white: #ffffff;

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 20px 48px rgba(15, 23, 42, 0.16);

  --container: 1180px;
}

/* ---- Blue theme (default) ---- */
:root,
:root[data-theme="blue"] {
  --primary-900: #05306b;
  --primary-700: #0a4b8c;
  --primary-600: #0f5fae;
  --primary-500: #1e73c9;
  --primary-400: #4b93de;
  --primary-100: #e7f0fb;
  --primary-050: #f4f8fd;
  --accent: #f5a623;
  --accent-dark: #d98c0f;
  --gradient: linear-gradient(135deg, #05306b 0%, #0f5fae 55%, #1e88c9 100%);
}

/* ---- Green theme ---- */
:root[data-theme="green"] {
  --primary-900: #0b3d2c;
  --primary-700: #0f6d4c;
  --primary-600: #128a5f;
  --primary-500: #16a374;
  --primary-400: #46bd93;
  --primary-100: #e5f6ef;
  --primary-050: #f3fbf7;
  --accent: #f5a623;
  --accent-dark: #d98c0f;
  --gradient: linear-gradient(135deg, #0b3d2c 0%, #0f6d4c 55%, #16a374 100%);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font);
  color: var(--ink-900);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { font-family: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.section { padding: 84px 0; }
.section--tight { padding: 56px 0; }
.section--alt { background: var(--primary-050); }

.eyebrow {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--primary-600);
  background: var(--primary-100);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 16px;
}

.section-head { max-width: 640px; margin: 0 auto 48px; text-align: center; }
.section-head h2 { font-size: clamp(26px, 3.4vw, 36px); font-weight: 700; color: var(--ink-900); margin-bottom: 12px; }
.section-head p { color: var(--ink-500); font-size: 16px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 26px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 15px;
  border: 2px solid transparent;
  transition: all .2s ease;
  white-space: nowrap;
}
.btn-primary { background: var(--primary-700); color: #fff; box-shadow: var(--shadow-sm); }
.btn-primary:hover { background: var(--primary-900); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-accent { background: var(--accent); color: #251a00; }
.btn-accent:hover { background: var(--accent-dark); transform: translateY(-1px); }
.btn-outline { background: transparent; border-color: rgba(255,255,255,.6); color: #fff; }
.btn-outline:hover { background: rgba(255,255,255,.14); }
.btn-ghost { background: var(--primary-100); color: var(--primary-700); }
.btn-ghost:hover { background: var(--primary-400); color: #fff; }
.btn-sm { padding: 9px 18px; font-size: 14px; }
.btn-block { width: 100%; }

/* ---------------- Header ---------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(255,255,255,.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--ink-100);
}
.site-header__bar {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 21px; color: var(--primary-800, var(--primary-900)); }
.brand__mark {
  width: 40px; height: 40px; border-radius: 11px;
  background: var(--gradient);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 17px;
  box-shadow: var(--shadow-sm);
}
.brand__name span { color: var(--primary-600); }

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  padding: 10px 16px; border-radius: 999px; font-size: 15px; font-weight: 500;
  color: var(--ink-700); transition: all .15s ease;
}
.nav a:hover { background: var(--primary-100); color: var(--primary-700); }
.nav a.is-active { background: var(--primary-700); color: #fff; }

.header-actions { display: flex; align-items: center; gap: 10px; }

.theme-toggle {
  display: flex; align-items: center; gap: 6px;
  background: var(--ink-100); border-radius: 999px; padding: 4px; position: relative;
}
.theme-toggle button {
  border: none; background: transparent; padding: 7px 13px; border-radius: 999px;
  font-size: 13px; font-weight: 600; color: var(--ink-500); display: flex; align-items: center; gap: 6px;
  transition: all .2s ease;
}
.theme-toggle button.is-active { background: #fff; color: var(--ink-900); box-shadow: var(--shadow-sm); }
.theme-toggle .dot { width: 9px; height: 9px; border-radius: 50%; }
.theme-toggle .dot--blue { background: #0f5fae; }
.theme-toggle .dot--green { background: #128a5f; }

.nav-toggle {
  display: none; border: none; background: var(--ink-100); width: 42px; height: 42px;
  border-radius: 10px; align-items: center; justify-content: center;
}
.nav-toggle span, .nav-toggle span::before, .nav-toggle span::after {
  content: ""; display: block; width: 20px; height: 2px; background: var(--ink-900); position: relative; transition: all .2s;
}
.nav-toggle span::before { position: absolute; top: -6px; }
.nav-toggle span::after { position: absolute; top: 6px; }

/* ---------------- Hero ---------------- */
.hero {
  background: var(--gradient);
  color: #fff;
  padding: 76px 0 96px;
  position: relative;
  overflow: hidden;
}
.hero::after {
  content: "";
  position: absolute; inset: 0;
  background: radial-gradient(circle at 82% 18%, rgba(255,255,255,.14), transparent 42%),
              radial-gradient(circle at 8% 92%, rgba(255,255,255,.10), transparent 40%);
  pointer-events: none;
}
.hero__grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 48px; align-items: center; position: relative; }
.hero h1 { font-size: clamp(32px, 4.6vw, 50px); font-weight: 700; line-height: 1.22; margin-bottom: 18px; }
.hero p.lead { font-size: 18px; color: rgba(255,255,255,.88); margin-bottom: 30px; max-width: 520px; }
.hero__cta { display: flex; gap: 14px; flex-wrap: wrap; margin-bottom: 36px; }
.hero__stats { display: flex; gap: 28px; flex-wrap: wrap; }
.hero__stats div strong { display: block; font-size: 26px; font-weight: 700; }
.hero__stats div span { font-size: 13px; color: rgba(255,255,255,.75); }

.hero__panel {
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius-lg);
  padding: 26px;
  backdrop-filter: blur(6px);
}
.hero__panel h3 { font-size: 15px; font-weight: 600; margin-bottom: 16px; color: rgba(255,255,255,.9); }
.hero-cat {
  display: flex; align-items: center; gap: 14px;
  background: rgba(255,255,255,.1);
  border-radius: var(--radius-md);
  padding: 13px 16px; margin-bottom: 10px;
  transition: all .18s ease;
}
.hero-cat:last-child { margin-bottom: 0; }
.hero-cat:hover { background: rgba(255,255,255,.2); transform: translateX(4px); }
.hero-cat .ic { width: 38px; height: 38px; border-radius: 10px; background: rgba(255,255,255,.18); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.hero-cat .ic svg { width: 20px; height: 20px; stroke: #fff; }
.hero-cat span { font-weight: 500; font-size: 14.5px; }

/* ---------------- Category cards (home) ---------------- */
.cat-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 20px; }
.cat-card {
  background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius-lg);
  padding: 28px 22px; text-align: center; transition: all .2s ease;
  box-shadow: var(--shadow-sm);
}
.cat-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-lg); border-color: var(--primary-400); }
.cat-card .ic {
  width: 60px; height: 60px; border-radius: 16px; margin: 0 auto 18px;
  background: var(--primary-100); display: flex; align-items: center; justify-content: center;
}
.cat-card .ic svg { width: 28px; height: 28px; stroke: var(--primary-700); }
.cat-card h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; }
.cat-card p { font-size: 13.5px; color: var(--ink-500); margin-bottom: 14px; }
.cat-card .link { font-size: 13.5px; font-weight: 600; color: var(--primary-600); display: inline-flex; align-items: center; gap: 4px; }

/* ---------------- Why us ---------------- */
.why-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.why-item { text-align: center; padding: 8px; }
.why-item .ic { width: 56px; height: 56px; border-radius: 50%; background: var(--primary-100); display:flex; align-items:center; justify-content:center; margin: 0 auto 16px; }
.why-item .ic svg { width: 26px; height: 26px; stroke: var(--primary-700); }
.why-item h4 { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.why-item p { font-size: 13.5px; color: var(--ink-500); }

/* ---------------- Page hero (inner pages) ---------------- */
.page-hero {
  background: var(--gradient); color: #fff; padding: 56px 0 76px; position: relative; overflow: hidden;
}
.page-hero::after {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 88% 10%, rgba(255,255,255,.14), transparent 40%);
}
.breadcrumb { font-size: 13px; color: rgba(255,255,255,.75); margin-bottom: 16px; position: relative; }
.breadcrumb a:hover { color: #fff; }
.page-hero__inner { position: relative; display: flex; align-items: center; gap: 22px; flex-wrap: wrap; justify-content: space-between; }
.page-hero .ic-badge {
  width: 64px; height: 64px; border-radius: 18px; background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.24); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.page-hero .ic-badge svg { width: 30px; height: 30px; stroke: #fff; }
.page-hero h1 { font-size: clamp(28px, 3.6vw, 40px); font-weight: 700; margin-bottom: 8px; }
.page-hero p { color: rgba(255,255,255,.85); max-width: 560px; font-size: 15.5px; }
.page-hero__cta { display:flex; gap:12px; flex-wrap:wrap; }

/* ---------------- Plan tiers (car insurance) ---------------- */
.tier-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-bottom: 20px; }
.tier-card {
  border: 1px solid var(--ink-100); border-radius: var(--radius-lg); padding: 26px 22px;
  background: #fff; box-shadow: var(--shadow-sm); position: relative; transition: all .2s ease;
}
.tier-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.tier-card.is-popular { border-color: var(--primary-500); box-shadow: var(--shadow-md); }
.tier-card .badge-pop {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: var(--accent); color: #251a00; font-size: 12px; font-weight: 700;
  padding: 5px 14px; border-radius: 999px;
}
.tier-card h3 { font-size: 19px; font-weight: 700; color: var(--primary-700); margin-bottom: 4px; }
.tier-card .sub { font-size: 13px; color: var(--ink-500); margin-bottom: 16px; }
.tier-card ul { display: flex; flex-direction: column; gap: 9px; margin-bottom: 18px; }
.tier-card li { display: flex; align-items: flex-start; gap: 8px; font-size: 13.5px; color: var(--ink-700); }
.tier-card li svg { width: 16px; height: 16px; stroke: var(--primary-600); flex-shrink: 0; margin-top: 2px; }
.tier-card li.no { color: var(--ink-300); }
.tier-card li.no svg { stroke: var(--ink-300); }

.table-wrap { overflow-x: auto; border-radius: var(--radius-lg); border: 1px solid var(--ink-100); box-shadow: var(--shadow-sm); }
table.compare { width: 100%; border-collapse: collapse; min-width: 640px; background: #fff; }
table.compare th, table.compare td { padding: 14px 18px; text-align: center; border-bottom: 1px solid var(--ink-100); font-size: 14px; }
table.compare thead th { background: var(--primary-050); color: var(--primary-800, var(--primary-900)); font-weight: 700; }
table.compare td:first-child, table.compare th:first-child { text-align: left; font-weight: 500; color: var(--ink-700); }
table.compare tbody tr:last-child td { border-bottom: none; }
table.compare .yes { color: var(--primary-600); font-weight: 700; }
table.compare .no { color: var(--ink-300); }

/* ---------------- Supplier grid ---------------- */
.supplier-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
.supplier-card {
  background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius-md);
  padding: 22px 16px; text-align: center; box-shadow: var(--shadow-sm); transition: all .18s ease;
}
.supplier-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: var(--primary-400); }
.supplier-card .logo {
  width: 56px; height: 56px; border-radius: 50%; margin: 0 auto 12px;
  background: var(--primary-100); color: var(--primary-700); font-weight: 700; font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.supplier-card h4 { font-size: 14px; font-weight: 600; color: var(--ink-900); }
.supplier-card p { font-size: 12px; color: var(--ink-500); margin-top: 4px; }
.supplier-note {
  margin-top: 18px; font-size: 13px; color: var(--ink-500); background: var(--primary-050);
  border: 1px dashed var(--primary-400); border-radius: var(--radius-sm); padding: 12px 16px;
}

/* ---------------- Sub-section tabs (group insurance) ---------------- */
.subsection { margin-bottom: 8px; }
.subsection__head { display: flex; align-items: center; gap: 14px; margin-bottom: 26px; }
.subsection__head .ic {
  width: 48px; height: 48px; border-radius: 13px; background: var(--primary-100);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.subsection__head .ic svg { width: 24px; height: 24px; stroke: var(--primary-700); }
.subsection__head h2 { font-size: 22px; font-weight: 700; }
.subsection__head p { font-size: 13.5px; color: var(--ink-500); }
.divider { height: 1px; background: var(--ink-100); margin: 56px 0; }

/* ---------------- Misc insurance list ---------------- */
.misc-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
.misc-card {
  background: #fff; border: 1px solid var(--ink-100); border-radius: var(--radius-lg); padding: 26px;
  box-shadow: var(--shadow-sm); transition: all .18s ease;
}
.misc-card:hover { box-shadow: var(--shadow-md); transform: translateY(-4px); }
.misc-card .ic { width: 52px; height: 52px; border-radius: 14px; background: var(--primary-100); display:flex; align-items:center; justify-content:center; margin-bottom: 16px; }
.misc-card .ic svg { width: 25px; height: 25px; stroke: var(--primary-700); }
.misc-card h3 { font-size: 17px; font-weight: 600; margin-bottom: 8px; }
.misc-card p { font-size: 13.5px; color: var(--ink-500); margin-bottom: 12px; }
.misc-card ul { display: flex; flex-direction: column; gap: 6px; }
.misc-card li { font-size: 13px; color: var(--ink-700); display: flex; gap: 7px; align-items: flex-start; }
.misc-card li::before { content: "•"; color: var(--primary-500); font-weight: 700; flex-shrink: 0; }
.misc-card li.no { color: var(--ink-500); }
.misc-card li.no::before { content: "×"; color: var(--ink-300); }

/* ---------------- CTA band ---------------- */
.cta-band {
  background: var(--gradient); border-radius: var(--radius-lg); padding: 48px 44px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px; flex-wrap: wrap;
  color: #fff;
}
.cta-band h3 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.cta-band p { color: rgba(255,255,255,.85); font-size: 14.5px; }
.cta-band__actions { display: flex; gap: 12px; flex-wrap: wrap; }

/* ---------------- Footer ---------------- */
.site-footer { background: var(--ink-900); color: rgba(255,255,255,.72); padding: 64px 0 28px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1.1fr; gap: 40px; margin-bottom: 40px; }
.footer-grid h5 { color: #fff; font-size: 14px; font-weight: 600; margin-bottom: 16px; }
.footer-grid ul { display: flex; flex-direction: column; gap: 10px; }
.footer-grid a { font-size: 13.5px; transition: color .15s; }
.footer-grid a:hover { color: #fff; }
.footer-brand { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.footer-brand .brand__mark { width: 36px; height: 36px; font-size: 15px; }
.footer-brand span { color: #fff; font-weight: 700; font-size: 18px; }
.footer-desc { font-size: 13.5px; line-height: 1.7; max-width: 300px; }
.footer-contact li { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.footer-contact svg { width: 16px; height: 16px; stroke: var(--primary-400); flex-shrink: 0; }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding-top: 22px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: 12.5px; color: rgba(255,255,255,.5); }

/* ---------------- Floating contact button + modal ---------------- */
.fab-contact {
  position: fixed; right: 24px; bottom: 24px; z-index: 90;
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--gradient); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 10px 26px rgba(15,23,42,.28);
  animation: pulse-fab 2.6s infinite;
}
.fab-contact svg { width: 26px; height: 26px; stroke: #fff; }
@keyframes pulse-fab {
  0%, 100% { box-shadow: 0 10px 26px rgba(15,23,42,.28); }
  50% { box-shadow: 0 10px 26px rgba(15,23,42,.28), 0 0 0 10px color-mix(in srgb, var(--primary-500) 18%, transparent); }
}

.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,.55); z-index: 100;
  display: none; align-items: center; justify-content: center; padding: 20px;
  backdrop-filter: blur(2px);
}
.modal-overlay.is-open { display: flex; }
.contact-modal {
  background: #fff; border-radius: var(--radius-lg); max-width: 380px; width: 100%;
  padding: 30px; position: relative; box-shadow: var(--shadow-lg);
}
.contact-modal__close {
  position: absolute; top: 16px; right: 16px; width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink-100); border: none; display: flex; align-items: center; justify-content: center;
}
.contact-modal__close svg { width: 16px; height: 16px; stroke: var(--ink-700); }
.contact-modal h3 { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.contact-modal .sub { font-size: 13.5px; color: var(--ink-500); margin-bottom: 22px; }
.contact-modal .qr {
  background: var(--primary-050); border: 1px solid var(--primary-100); border-radius: var(--radius-md);
  padding: 18px; text-align: center; margin-bottom: 20px;
}
.contact-modal .qr img { width: 150px; height: 150px; margin: 0 auto 10px; }
.contact-modal .qr span { font-size: 12.5px; color: var(--ink-500); }
.contact-list { display: flex; flex-direction: column; gap: 10px; }
.contact-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--ink-100); transition: all .15s ease;
}
.contact-row:hover { background: var(--primary-100); }
.contact-row .ic { width: 36px; height: 36px; border-radius: 50%; background: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; box-shadow: var(--shadow-sm); }
.contact-row .ic svg { width: 17px; height: 17px; stroke: var(--primary-700); }
.contact-row strong { display: block; font-size: 13.5px; }
.contact-row span { font-size: 12px; color: var(--ink-500); }

/* ---------------- Mobile ---------------- */
@media (max-width: 980px) {
  .hero__grid { grid-template-columns: 1fr; }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .why-grid { grid-template-columns: repeat(2, 1fr); }
  .tier-grid { grid-template-columns: repeat(2, 1fr); }
  .supplier-grid { grid-template-columns: repeat(3, 1fr); }
  .misc-grid { grid-template-columns: repeat(2, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav { position: fixed; top: 76px; left: 0; right: 0; background: #fff; flex-direction: column;
    align-items: stretch; padding: 12px; border-bottom: 1px solid var(--ink-100); box-shadow: var(--shadow-md);
    transform: translateY(-130%); opacity: 0; transition: all .22s ease; pointer-events: none; gap: 2px; }
  .nav.is-open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav a { padding: 13px 16px; }
  .nav-toggle { display: flex; }
  .theme-toggle span.label { display: none; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
  .why-grid { grid-template-columns: 1fr; }
  .tier-grid { grid-template-columns: 1fr; }
  .supplier-grid { grid-template-columns: repeat(2, 1fr); }
  .misc-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .cta-band { flex-direction: column; text-align: center; }
  .page-hero__inner { flex-direction: column; align-items: flex-start; }
  .section { padding: 56px 0; }
}
