/* Thai2Music — design tokens & base components
   Fonts: โฮสต์เองที่ assets/fonts (โหลดผ่าน assets/css/fonts.css + preload ใน <head>) — Anuphan, IBM Plex Sans Thai Looped, IBM Plex Mono */

:root {
  /* color */
  --ink: #141414;
  --accent: #C62F17;
  --brand-orange: #F7941D;
  --brand-red: #E6461E;
  --brand-deep: #9B1111;
  --bg: #FFFFFF;
  --bg-soft: #F6F5F2;
  --bg-mute: #F3F1EE;
  --line: #ECEAE6;
  --line-card: #E4E1DC;
  --line-input: #D9D5CF;
  --text-2: #4A4843;
  --text-3: #6B6862;
  --text-4: #8F8B84;
  --peach-bg: #FDF0E4;
  --peach-fg: #8A3B0A;
  --peach-ink: #5A2A08;
  --green-bg: #E3F2E8;
  --green-fg: #1E5A32;
  --green: #1E7A3C;
  --line-app: #06A04A;
  --wave: linear-gradient(90deg, #F7941D 0%, #E6461E 60%, #9B1111 100%);

  /* type */
  --font-display: 'Anuphan', sans-serif;
  --font-body: 'IBM Plex Sans Thai Looped', sans-serif;
  --font-mono: 'IBM Plex Mono', monospace;

  /* shape */
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 18px;
  --r-pill: 999px;
  --tap: 44px;
  --container: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { color: var(--ink); }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.t2m-container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
@media (max-width: 860px) { .t2m-container { padding: 0 16px; } }

/* type */
.t2m-h1 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(30px, 4.4vw, 56px); line-height: 1.12; }
.t2m-h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(22px, 2.6vw, 32px); line-height: 1.25; }
.t2m-h3 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 20px; line-height: 1.35; }
.t2m-dot { color: var(--accent); }                 /* เริ่มจากบอกเรา<span class="t2m-dot">.</span> */
.t2m-eyebrow { margin: 0; font-family: var(--font-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-3); }
.t2m-lead { margin: 0; font-size: 17px; line-height: 1.7; color: var(--text-2); }
.t2m-sub { font-size: 13px; color: var(--text-3); }

/* buttons */
.t2m-btn, .t2m-btn-dark, .t2m-btn-outline {
  min-height: 48px; padding: 0 20px; border-radius: var(--r-md); border: 0;
  font: inherit; font-size: 16px; font-weight: 600; text-decoration: none; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: filter .15s ease;
}
.t2m-btn { background: var(--accent); color: #FFF; }
.t2m-btn-dark { background: var(--ink); color: #FFF; }
.t2m-btn-outline { background: #FFF; color: var(--ink); border: 1.5px solid var(--ink); }
.t2m-btn:hover, .t2m-btn-dark:hover { filter: brightness(1.08); color: #FFF; }
.t2m-btn:disabled { background: var(--line-input); color: var(--text-3); cursor: not-allowed; }
.t2m-btn-line { background: var(--line-app); color: #FFF; }
.t2m-icon-btn { width: var(--tap); height: var(--tap); flex: none; border-radius: var(--r-pill); border: 1px solid #E2DFDA; background: #FFF; display: inline-flex; align-items: center; justify-content: center; color: var(--ink); cursor: pointer; }

/* chips & pills */
.t2m-chip { flex: none; min-height: 40px; padding: 0 14px; border-radius: var(--r-pill); border: 1px solid var(--line-input); background: #FFF; font: inherit; font-size: 14px; font-weight: 600; color: var(--ink); cursor: pointer; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.t2m-chip[aria-pressed="true"], .t2m-chip[aria-selected="true"] { background: var(--ink); border-color: var(--ink); color: #FFF; }
.t2m-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; }
.t2m-pill { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: var(--r-pill); background: var(--bg-mute); color: var(--text-2); white-space: nowrap; }
.t2m-pill--warn { background: var(--peach-bg); color: var(--peach-fg); }
.t2m-pill--ok { background: var(--green-bg); color: var(--green-fg); }

/* surfaces */
.t2m-card { background: #FFF; border: 1px solid var(--line-card); border-radius: var(--r-lg); padding: 20px; }
.t2m-card--soft { background: #FFF; border: 0; border-radius: 16px; padding: 16px; } /* บนพื้น --bg-soft */
.t2m-card--dark { background: var(--ink); color: #FFF; border-radius: 20px; padding: 24px; }
.t2m-note { background: var(--peach-bg); color: var(--peach-ink); border-radius: var(--r-md); padding: 12px 14px; }

/* form */
.t2m-field { width: 100%; min-height: 48px; padding: 0 14px; border: 1px solid var(--line-input); border-radius: 12px; background: #FFF; font: inherit; font-size: 16px; color: var(--ink); }
.t2m-field:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.t2m-label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
.t2m-otp { text-align: center; font-family: var(--font-mono); font-size: 30px; letter-spacing: .5em; min-height: 68px; }

/* header */
.t2m-header { border-bottom: 1px solid var(--line); background: #FFF; position: sticky; top: 0; z-index: 20; }
.t2m-header__in { max-width: var(--container); margin: 0 auto; padding: 14px 24px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.t2m-header__logo img { height: 46px; width: auto; display: block; }
.t2m-nav { display: flex; align-items: center; gap: 28px; font-size: 15px; font-weight: 500; }
.t2m-nav a { text-decoration: none; }
.t2m-nav a[aria-current="page"] { color: var(--accent); }
@media (max-width: 860px) {
  .t2m-header__in { padding: 10px 16px; }
  .t2m-header__logo img { height: 36px; }
  .t2m-nav { display: none; }
}

/* signature wave: <div class="t2m-wave"></div> หรือใช้ SVG ใน Main.dc.html */
.t2m-wave { height: 4px; border-radius: 4px; background: var(--wave); position: relative; margin-left: 10px; }
.t2m-wave::before { content: ""; position: absolute; left: -10px; top: 50%; width: 9px; height: 9px; border-radius: 50%; background: var(--brand-orange); transform: translateY(-50%); }

/* accordion */
.t2m-acc { border-bottom: 1px solid var(--line); }
.t2m-acc > summary { list-style: none; cursor: pointer; padding: 14px 0; display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.t2m-acc > summary::after { content: "+"; color: var(--text-4); font-size: 20px; line-height: 1; }
.t2m-acc[open] > summary::after { content: "−"; }

/* mobile app chrome */
.t2m-bottom-bar { position: sticky; bottom: 0; background: #FFF; border-top: 1px solid var(--line); padding: 12px 16px 20px; display: flex; gap: 10px; align-items: center; z-index: 10; }
.t2m-tabbar { position: sticky; bottom: 0; background: #FFF; border-top: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, 1fr); padding: 6px 4px 18px; }
.t2m-tabbar a, .t2m-tabbar button { border: 0; background: none; font: inherit; font-size: 11px; color: var(--text-4); display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 6px 0; text-decoration: none; min-height: var(--tap); }
.t2m-tabbar [aria-current="page"] { color: var(--accent); font-weight: 600; }
@media (min-width: 861px) { .t2m-tabbar, .t2m-bottom-bar--mobile { display: none; } }

/* locked price */
.t2m-price-locked { font-family: var(--font-display); font-weight: 700; color: #B5B1AA; letter-spacing: .02em; }
