/* เว็บระดมทุน investor.allevservice.app — โทนเดียวกับเว็บหลัก (น้ำเงินเข้ม + ส้มอำพัน) อ่านจากบนลงล่างเหมือนเอกสารเสนอการลงทุน */
:root {
  --bg: #f8fafc; --bg-alt: #f1f5f9; --card: #ffffff; --text: #0f172a; --muted: #64748b; --line: #e2e8f0;
  --brand: #f59e0b; --brand-dark: #b45309; --brand-soft: #fef3c7; --brand-ink: #1c1917;
  --ok: #047857; --ok-soft: #d1fae5; --warn: #b91c1c; --warn-soft: #fee2e2;
  --hero: #0f172a; --hero-2: #1e293b;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 8px 24px -12px rgba(15, 23, 42, .18);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b1220; --bg-alt: #0f172a; --card: #162032; --text: #e2e8f0; --muted: #94a3b8; --line: #253349;
    --brand-dark: #fbbf24; --brand-soft: #3b2a09; --ok: #34d399; --ok-soft: #0b2e22; --warn: #f87171; --warn-soft: #3a1515;
    --hero: #0b1220; --hero-2: #162032;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px -12px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0b1220; --bg-alt: #0f172a; --card: #162032; --text: #e2e8f0; --muted: #94a3b8; --line: #253349;
  --brand-dark: #fbbf24; --brand-soft: #3b2a09; --ok: #34d399; --ok-soft: #0b2e22; --warn: #f87171; --warn-soft: #3a1515;
  --hero: #0b1220; --hero-2: #162032; color-scheme: dark;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: "Noto Sans Thai", "Sarabun", "Leelawadee UI", Tahoma, system-ui, sans-serif; font-size: 16px; line-height: 1.65; }
h1, h2, h3 { margin: 0; line-height: 1.25; font-weight: 700; text-wrap: balance; }
h1 { font-size: clamp(1.8rem, 4.8vw, 2.9rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 1.9rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 .75rem; }
a { color: inherit; }
img { max-width: 100%; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.num { font-variant-numeric: tabular-nums; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.eyebrow { display: inline-block; font-size: .85rem; font-weight: 600; letter-spacing: .04em; color: var(--brand); text-transform: uppercase; margin-bottom: 12px; }
.section { padding: 56px 0; }
.section.alt { background: var(--bg-alt); }
.section-head { max-width: 50rem; margin-bottom: 28px; }
.section-head p { color: var(--muted); margin-top: 8px; }
.grid { display: grid; gap: 16px; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--brand); color: var(--brand-ink); padding: 8px 12px; border-radius: 8px; z-index: 100; }
.skip:focus { left: 8px; }

/* ปุ่ม */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 8px 18px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: var(--text); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease, background .12s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow); }
.btn.brand { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.brand:hover { background: #fbbf24; }
.btn.ghost { background: transparent; border-color: rgba(255, 255, 255, .35); color: #fff; }
.btn.ghost:hover { background: rgba(255, 255, 255, .08); }
.btn.sm { min-height: 38px; padding: 6px 14px; font-size: .9rem; }
.btn.lg { min-height: 50px; padding: 10px 24px; font-size: 1.05rem; }
.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* แถบบน */
.topbar { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.topbar .wrap { display: flex; align-items: center; gap: 16px; min-height: 68px; }
.logo { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.logo-img { display: block; width: auto; height: 50px; }
.logo span { font-weight: 700; font-size: .95rem; color: var(--muted); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .logo-img { filter: drop-shadow(0 0 2px rgba(255, 255, 255, .6)); } }
.nav { display: none; gap: 2px; margin-left: auto; }
.nav a { padding: 8px 9px; border-radius: 8px; text-decoration: none; font-weight: 500; color: var(--muted); font-size: .92rem; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--bg-alt); }
.topbar .btn { margin-left: auto; white-space: nowrap; }
.logo span { white-space: nowrap; }
@media (min-width: 1024px) { .nav { display: flex; } .topbar .btn { margin-left: 0; } }

/* ฮีโร่ */
.hero { position: relative; color: #fff; background: radial-gradient(1200px 500px at 85% -10%, rgba(245, 158, 11, .28), transparent 60%), linear-gradient(160deg, var(--hero), var(--hero-2)); padding: 56px 0 40px; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 40%; opacity: .22; pointer-events: none; }
.hero .wrap { position: relative; }
.hero h1 { max-width: 20ch; }
.lead { font-size: 1.1rem; color: rgba(255, 255, 255, .8); max-width: 46rem; margin: 16px 0 24px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-points { list-style: none; margin: 32px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.hero-points li { background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .14); border-radius: var(--radius); padding: 14px 16px; }
.hero-points li:first-child { background: rgba(245, 158, 11, .18); border-color: rgba(245, 158, 11, .5); }
.hero-points b { display: block; font-size: 1.35rem; font-weight: 800; color: var(--brand); line-height: 1.2; }
.hero-points span { font-size: .9rem; color: rgba(255, 255, 255, .78); }
@media (min-width: 860px) { .hero { padding: 72px 0 48px; } .hero-points { grid-template-columns: repeat(4, 1fr); margin-top: 44px; } }

.hero-note { margin: 18px 0 0; font-size: .95rem; color: rgba(255, 255, 255, .78); }
.hero-note b { color: #fff; }
.hero-note a { color: var(--brand); font-weight: 600; }

/* ตัวเลขจริง */
.stat-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, 1fr); margin-bottom: 16px; }
.stat { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; }
.stat b { display: block; font-size: 1.5rem; font-weight: 800; line-height: 1.2; }
.stat span { color: var(--muted); font-size: .85rem; }
.stat.hl { background: var(--hero); border-color: var(--hero); color: #fff; }
.stat.hl b { color: var(--brand); }
.stat.hl span { color: rgba(255, 255, 255, .78); }
.proof-grid { display: grid; gap: 16px; }
.brand-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.brand-bars li { display: grid; grid-template-columns: 4.5em 1fr 4.5em; align-items: center; gap: 10px; font-size: .92rem; }
.brand-bars b { text-align: right; font-variant-numeric: tabular-nums; }
.brand-bars .bar { height: 10px; }
@media (min-width: 760px) { .stat-grid { grid-template-columns: repeat(4, 1fr); } .proof-grid { grid-template-columns: 1fr 1fr; } }

/* แถบตัวเลขรวม */
.facts { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-top: -28px; position: relative; box-shadow: var(--shadow); }
.fact { background: var(--card); padding: 18px 20px; }
.fact b { display: block; font-size: 1.6rem; font-weight: 800; }
.fact span { color: var(--muted); font-size: .9rem; }
.fact.open { background: var(--brand-soft); }
.fact.open b { color: var(--brand-dark); }
@media (min-width: 760px) { .facts { grid-template-columns: repeat(5, 1fr); } }

/* ไทม์ไลน์ 3 ปี */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.timeline li { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); position: relative; }
.timeline .n { display: inline-grid; place-items: center; min-width: 34px; height: 34px; padding: 0 10px; border-radius: 999px; background: var(--hero); color: var(--brand); font-weight: 800; font-size: .9rem; margin-bottom: 10px; }
.timeline h3 { margin-bottom: 6px; }
.timeline p { color: var(--muted); font-size: .95rem; margin: 0; }
.choice { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 16px; }
.choice .card { border-top: 4px solid var(--brand); }
.choice .card.b { border-top-color: var(--ok); }
.choice h3 { margin-bottom: 8px; }
.choice ul { margin: 0; padding-left: 20px; color: var(--muted); font-size: .95rem; }
.choice li { margin-bottom: 4px; }
.tag { display: inline-block; font-size: .8rem; font-weight: 600; padding: 2px 10px; border-radius: 999px; background: var(--brand-soft); color: var(--brand-dark); margin-bottom: 8px; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }

/* สาขา */
.branches { grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); }
.branch { display: flex; flex-direction: column; gap: 8px; }
.branch-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.branch h3 { font-size: 1.2rem; }
.branch .area { color: var(--muted); font-size: .9rem; }
.chip { font-size: .78rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; }
.chip.w1 { background: var(--brand-soft); color: var(--brand-dark); }
.chip.w2 { background: var(--bg-alt); color: var(--muted); border: 1px solid var(--line); }
.chip.full { background: var(--ok-soft); color: var(--ok); }
.branch .why { color: var(--muted); font-size: .92rem; margin: 0; flex: 1; }
.bar { height: 8px; border-radius: 999px; background: var(--bg-alt); border: 1px solid var(--line); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .4s ease; }
.bar.done i { background: var(--ok); }
.slots { display: flex; justify-content: space-between; font-size: .85rem; color: var(--muted); }
.slots b { color: var(--text); }
.branch .btn { margin-top: 4px; }
.branch.selected { outline: 2px solid var(--brand); outline-offset: 0; }
.legend { display: flex; flex-wrap: wrap; gap: 12px 20px; margin-top: 16px; font-size: .9rem; color: var(--muted); }

/* เครื่องคำนวณ */
.calc { display: grid; gap: 24px; }
.calc label { display: block; font-weight: 600; margin-bottom: 6px; }
.calc select, .calc input[type="number"] { width: 100%; min-height: 46px; padding: 10px 14px; font: inherit; color: var(--text); background: var(--card); border: 1px solid var(--line); border-radius: 10px; }
.calc select:focus, .calc input:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
.stepper { display: flex; align-items: center; gap: 12px; }
.stepper button { width: 48px; height: 48px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-alt); color: var(--text); font-size: 1.5rem; cursor: pointer; }
.stepper button:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.stepper output { font-size: 2.4rem; font-weight: 800; min-width: 2ch; text-align: center; }
.stepper .hint { color: var(--muted); font-size: .9rem; }
.field { margin-bottom: 18px; }
.out { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.out div { border-top: 1px solid var(--line); padding-top: 8px; }
.out b { display: block; font-size: 1.4rem; font-weight: 800; }
.out span { color: var(--muted); font-size: .85rem; }
.out .hl b { color: var(--brand-dark); }
.compare { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); margin-top: 20px; }
.compare .card { padding: 18px; }
.compare h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.compare dl { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; font-size: .95rem; }
.compare dt { color: var(--muted); }
.compare dd { margin: 0; text-align: right; font-weight: 600; }
.compare dd.big { font-size: 1.25rem; color: var(--brand-dark); }
.compare .b dd.big { color: var(--ok); }
.assume { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 12px; font-size: .9rem; color: var(--muted); }
.assume input, .assume select { min-height: 40px; padding: 6px 10px; font: inherit; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--text); }
.assume input { width: 150px; }
@media (min-width: 860px) { .calc { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); } }
@media (max-width: 480px) { .out { grid-template-columns: 1fr; } }

/* ตาราง */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 12px; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
th { background: var(--bg-alt); font-weight: 600; color: var(--muted); font-size: .85rem; white-space: nowrap; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
tfoot td { font-weight: 700; background: var(--bg-alt); }
tr:last-child td { border-bottom: 0; }
.funds-bar { display: flex; height: 14px; border-radius: 999px; overflow: hidden; border: 1px solid var(--line); margin: 16px 0 8px; }
.funds-bar i { display: block; height: 100%; }
.funds-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .85rem; color: var(--muted); }
.funds-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }

/* แบบมาตรฐานสาขา */
.design-grid { display: grid; gap: 16px; }
figure.design { margin: 0; padding: 0; overflow: hidden; }
figure.design img { display: block; width: 100%; height: auto; }
figure.design figcaption { padding: 12px 16px; font-size: .9rem; color: var(--muted); }
@media (min-width: 860px) { .design-grid { grid-template-columns: 1fr 1fr; } }

/* ทำไมต้องเรา */
.why-grid { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.why .icon { width: 44px; height: 44px; display: grid; place-items: center; border-radius: 10px; background: color-mix(in srgb, var(--brand) 16%, var(--card)); font-size: 1.4rem; margin-bottom: 12px; }
.why h3 { margin-bottom: 6px; }
.why p { color: var(--muted); font-size: .95rem; margin: 0; }
.duo { display: grid; gap: 16px; padding: 0; overflow: hidden; }
.duo img { display: block; width: 100%; height: 100%; object-fit: cover; aspect-ratio: 5 / 4; }
.duo > div { padding: 0 20px 20px; }
@media (min-width: 700px) { .duo { grid-template-columns: 42% 1fr; align-items: center; } .duo > div { padding: 20px 20px 20px 0; } }

/* เงื่อนไขและความเสี่ยง */
.risks { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); margin-bottom: 24px; }
.risk { border-left: 3px solid var(--brand); padding: 4px 0 4px 14px; }
.risk h3 { font-size: 1rem; margin-bottom: 4px; }
.risk p { color: var(--muted); font-size: .95rem; margin: 0; }
.terms th { width: 11em; white-space: normal; }
.terms td { white-space: normal; }

/* ฟอร์มสมัคร */
.apply-grid { display: grid; gap: 24px; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.steps li { display: grid; grid-template-columns: 30px 1fr; gap: 10px; align-items: start; }
.steps .n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--hero); color: var(--brand); font-weight: 800; font-size: .85rem; }
.steps b { display: block; }
.steps span { color: var(--muted); font-size: .9rem; }
form.apply { display: grid; gap: 14px; }
form.apply label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .95rem; }
form.apply input, form.apply select, form.apply textarea { width: 100%; min-height: 46px; padding: 10px 14px; font: inherit; font-weight: 400; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
form.apply textarea { min-height: 84px; resize: vertical; }
form.apply input:focus, form.apply select:focus, form.apply textarea:focus { outline: 2px solid var(--brand); outline-offset: 1px; }
form.apply .two { display: grid; gap: 14px; grid-template-columns: 1fr 1fr; }
form.apply .check { flex-direction: row; align-items: flex-start; gap: 10px; font-weight: 400; font-size: .92rem; }
form.apply .check input { width: 20px; height: 20px; min-height: 0; margin-top: 3px; flex: none; accent-color: var(--brand); }
form.apply .err { font-size: .85rem; color: var(--warn); min-height: 0; }
form.apply .err:empty { display: none; }
.done { background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 40%, transparent); border-radius: var(--radius); padding: 20px; }
.done b.ref { font-size: 1.4rem; display: block; margin-bottom: 6px; }
.done .btn { margin-top: 10px; }
@media (min-width: 860px) { .apply-grid { grid-template-columns: minmax(0, .8fr) minmax(0, 1.2fr); align-items: start; } }
@media (max-width: 480px) { form.apply .two { grid-template-columns: 1fr; } }

/* ท้ายหน้า */
.footer { border-top: 1px solid var(--line); padding: 32px 0; }
.footer-grid { display: grid; gap: 16px; }
.footer .logo-img { height: 56px; margin-bottom: 6px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 14px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--text); }
.disclaimer { font-size: .82rem; color: var(--muted); max-width: 60rem; }
