/* Customer site theme — "Ember glow" (owner pick 2026-11-11: black with an
   orange sub-colour, moving shade instead of a flat page).

   Applies ONLY when <html> has the class site-customer (set by the inline
   script in index.html for warranty.konythailand.com and for ?customer
   previews). Kony ETP, the staff app, never gets this class and keeps the
   Organic look from styles.css.

   How it works: the same components, re-tokened.
   - surface / text / divider tokens go dark;
   - the ACCENT ramp is turned around (100 = a dark orange tint … 900 = a pale
     orange), because the app uses 100–200 as backgrounds and 700–800 as text;
   - the NEUTRAL steps are set one by one by their use (see the note there):
     the lightbox and the toast need 100 light and 900 dark;
   - --ok-* / --err-* / --pdf-* (defined light in styles.css) get dark values.
   Decoration: two slow-breathing glows and a few rising sparks (.kc-fx, drawn
   by customer.js), a light streak under the top bar. All motion stops under
   prefers-reduced-motion. */

html.site-customer {
  color-scheme: dark;
  --color-bg: #0b0b0c;
  --color-surface: #18181a;
  --color-text: #f3f1ee;
  --color-accent: #ff7a1a;
  --color-divider: color-mix(in srgb, #f3f1ee 14%, transparent);

  /* by what each step is USED for on these pages, not a straight ramp:
     100 text on the lightbox / toast (light) · 200 quiet fills under normal text
     (dark) · 300–400 hairlines, dashed boxes, spinner · 600–700 secondary text
     (light grey) · 800 text of .tag-neutral on 100 · 900 lightbox / toast ground */
  --color-neutral-100: #f4f2ef;
  --color-neutral-200: #232326;
  --color-neutral-300: #4a4a4e;
  --color-neutral-400: #5c5c61;
  --color-neutral-500: #7d7b78;
  --color-neutral-600: #9d9a96;
  --color-neutral-700: #b3b1ad;
  --color-neutral-800: #2a2a2b;
  --color-neutral-900: #050506;

  --color-accent-100: #24160d;
  --color-accent-200: #35200f;
  --color-accent-300: #5a3212;
  --color-accent-400: #8c4a14;
  --color-accent-500: #d9641a;
  --color-accent-600: #ff8f33;
  --color-accent-700: #ff9d55;
  --color-accent-800: #ffb47a;
  --color-accent-900: #ffd3ae;

  --status-rejected-text: #ff8576;
  --status-rejected-bg: #3a1f1c;

  --ok-bg: rgba(74, 222, 128, 0.14);
  --ok-text: #7ee2a0;
  --err-bg: rgba(255, 99, 71, 0.15);
  --err-text: #ffa191;
  --err-line: #ff6b57;
  --pdf-bg: #3a1f1c;
  --pdf-text: #dcb8b2;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.5);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 18px 44px rgba(0, 0, 0, 0.7);
}
html.site-customer, html.site-customer body { background: #0b0b0c; }

/* ── the page ground: glows + sparks behind everything ── */
html.site-customer .jhc-shell { background: #0b0b0c; }
html.site-customer .jhc-main { isolation: isolate; }
html.site-customer .kc-fx { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: -1; }
html.site-customer .kc-fx::before,
html.site-customer .kc-fx::after { content: ''; position: absolute; border-radius: 50%; will-change: transform, opacity; }
html.site-customer .kc-fx::before {
  top: -190px; right: -200px; width: 560px; height: 560px;
  background: radial-gradient(circle, rgba(255,106,0,0.44) 0%, rgba(255,106,0,0.13) 36%, rgba(255,106,0,0) 70%);
  animation: kc-breathe 9s ease-in-out infinite alternate;
}
html.site-customer .kc-fx::after {
  bottom: -260px; left: -220px; width: 580px; height: 580px;
  background: radial-gradient(circle, rgba(255,80,0,0.2) 0%, rgba(255,80,0,0) 68%);
  animation: kc-breathe 13s ease-in-out infinite alternate-reverse;
}
@keyframes kc-breathe {
  from { transform: scale(0.92) translate3d(0, 0, 0); opacity: 0.75; }
  to   { transform: scale(1.1) translate3d(-18px, 14px, 0); opacity: 1; }
}
/* sparks: small embers that drift up from the top-right glow and fade */
html.site-customer .kc-fx i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: #ffb066; box-shadow: 0 0 6px 1px rgba(255,130,40,0.9);
  opacity: 0; animation: kc-spark 7s linear infinite;
}
html.site-customer .kc-fx i:nth-child(1) { top: 210px; right: 60px;  animation-delay: 0s; }
html.site-customer .kc-fx i:nth-child(2) { top: 260px; right: 150px; width: 2px; height: 2px; animation-delay: 1.6s; animation-duration: 8.5s; }
html.site-customer .kc-fx i:nth-child(3) { top: 170px; right: 230px; width: 2px; height: 2px; background: #ffc48a; animation-delay: 3.1s; animation-duration: 9s; }
html.site-customer .kc-fx i:nth-child(4) { top: 320px; right: 36px;  width: 2px; height: 2px; background: #ff7a1a; animation-delay: 4.4s; animation-duration: 6.5s; }
html.site-customer .kc-fx i:nth-child(5) { top: 290px; right: 110px; animation-delay: 5.5s; animation-duration: 10s; }
html.site-customer .kc-fx i:nth-child(6) { top: 230px; right: 300px; width: 2px; height: 2px; animation-delay: 2.4s; animation-duration: 11s; }
@keyframes kc-spark {
  0%   { transform: translate3d(0, 0, 0); opacity: 0; }
  12%  { opacity: 1; }
  70%  { opacity: 0.8; }
  100% { transform: translate3d(-46px, -190px, 0); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  html.site-customer .kc-fx::before, html.site-customer .kc-fx::after { animation: none; }
  html.site-customer .kc-fx i { animation: none; opacity: 0.85; }
}

/* ── top bar: see-through, with the light streak for a bottom edge ── */
html.site-customer .jhc-topbar { position: relative; border-bottom: none; background: linear-gradient(180deg, rgba(11,11,12,0.9), rgba(11,11,12,0.55)); }
html.site-customer .jhc-topbar::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; pointer-events: none;
  background: linear-gradient(90deg, #ff6a00 0%, #ff7a1a 28%, #fff1dd 60%, rgba(255,122,26,0.2) 86%, rgba(255,122,26,0) 100%);
  box-shadow: 0 0 18px 2px rgba(255,106,0,0.6);
}
html.site-customer .jhc-topbar h1 { letter-spacing: 0; }

/* ── the bar itself (2026-11-12): logo · tabs · language · account — the tabs
   are always on show, there is no drawer on this site. Three widths:
   wide = one row; ≤1120px = language · logo · account over a row of four tabs;
   ≤560px = each tab's icon above its label. ── */
html.site-customer { --kc-col: 1040px; }
/* the bar fills the window edge to edge (owner 2026-11-12); only the PAGE below sits in the column */
html.site-customer .kc-top { z-index: 40; padding-top: 10px; padding-bottom: 12px; }
html.site-customer .kc-bar { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "logo nav lang acct"; align-items: center; gap: 8px 12px; }
html.site-customer .kc-logo-btn { grid-area: logo; display: flex; padding: 0; border: 0; background: none; cursor: pointer; }
html.site-customer .kc-logo { display: block; height: 40px; width: auto; }
html.site-customer .kc-nav { grid-area: nav; display: flex; gap: 6px; min-width: 0; padding-left: 10px; }
html.site-customer .kc-tab {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 0;
  padding: 8px 12px; border-radius: 10px; border: 1px solid transparent; background: none;
  color: #d9d6d1; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.25; white-space: nowrap; cursor: pointer;
}
html.site-customer .kc-tab:hover { background: rgba(255, 255, 255, 0.07); }
html.site-customer .kc-tab.active { background: #24160d; border-color: #ff7a1a; color: #ff9d55; box-shadow: 0 0 14px -4px rgba(255, 106, 0, 0.7); }
html.site-customer .kc-tab-ico { display: inline-flex; flex: none; }
html.site-customer .kc-lang { grid-area: lang; position: relative; z-index: 2; }
html.site-customer .kc-acct { grid-area: acct; position: relative; z-index: 2; }
html.site-customer .kc-tool.btn { gap: 6px; padding: 7px 11px; min-height: 0; font-size: 13px; white-space: nowrap; }
html.site-customer .kc-tool-on.btn { color: #ff9d55; border-color: #5a3212; }
html.site-customer .card.kc-drop { position: absolute; top: 100%; margin-top: 8px; z-index: 3; background: #1b1b1d; border-color: #3a3a3e; }
html.site-customer .kc-menu-back { position: fixed; inset: 0; z-index: 1; }
/* the tab's full title is the first row of the page */
/* bottom margin = the scroll area's padding: a page that starts with a
   .jhc-sticky-top bar pulls that bar's ground up by exactly this much, and it
   must not reach the title */
html.site-customer .kc-titlerow { position: relative; z-index: 21; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 0 0 var(--space-6); }
/* one column for the whole page */
html.site-customer #jhc-scroll { overflow-x: hidden; }
html.site-customer .kc-page { max-width: var(--kc-col); margin: 0 auto; }
html.site-customer .jhc-pagecol { max-width: none !important; }
@media (max-width: 760px) { html.site-customer .kc-titlerow { margin-bottom: var(--space-3); } }
html.site-customer .kc-title { flex: 1 1 200px; min-width: 0; margin: 0; font-size: 22px; line-height: 1.3; letter-spacing: 0; }
@media (max-width: 1120px) {   /* 1120 since the fourth tab reads คู่มือการใช้งานสินค้า (2026-11-18) */
  html.site-customer .kc-bar { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); grid-template-areas: "lang logo acct" "nav nav nav"; gap: 10px 8px; }
  html.site-customer .kc-lang { justify-self: start; }
  html.site-customer .kc-acct { justify-self: end; }
  html.site-customer .kc-nav { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-left: 0; }
}
@media (max-width: 560px) {
  html.site-customer .kc-top { padding-top: 8px; padding-bottom: 10px; }
  html.site-customer .kc-logo { height: 34px; }
  html.site-customer .kc-nav { gap: 4px; }
  /* icons on one line whether the label takes one row or two */
  html.site-customer .kc-tab { flex-direction: column; justify-content: flex-start; gap: 3px; padding: 6px 2px; font-size: 11.5px; white-space: normal; text-align: center; }
  html.site-customer .kc-title { font-size: 18px; }
}
html.site-customer .kc-kicker { font-size: 12px; font-weight: 800; letter-spacing: 0.22em; color: #ff8a3d; }

/* ── surfaces ── */
/* a touch see-through, so the glow behind tints the cards as it breathes */
html.site-customer .card { background: linear-gradient(180deg, rgba(29,29,31,0.9) 0%, rgba(21,21,22,0.92) 100%); border: 1px solid #2b2b2e; }
html.site-customer .kc-kicker { display: block; }
html.site-customer .jhc-quote-card:hover { background: linear-gradient(180deg, #232326 0%, #1c1c1e 100%) !important; border-color: #5a3212; }
html.site-customer .dialog { background: #18181a; border: 1px solid #2f2f33; }
html.site-customer .dialog-backdrop { background: rgba(0, 0, 0, 0.68); }
html.site-customer .jhc-drawer-backdrop { background: rgba(0, 0, 0, 0.6); }
html.site-customer .jhc-sidebar { background: #111112; border-right: 1px solid #2b2b2e; }
html.site-customer .jhc-nav-item.active { background: linear-gradient(180deg, #ff8f33 0%, #f25c05 100%); color: #140a02; }
html.site-customer .jhc-nav-item.active:hover { background: linear-gradient(180deg, #ff8f33 0%, #f25c05 100%); }
/* bars that stay put while the page scrolls: dark glass, so the glow shows through */
html.site-customer .jhc-sticky-top,
html.site-customer .jhc-detail-topbar { background: rgba(11, 11, 12, 0.8); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
/* in the page column the bar is narrower than the window: its glass would show
   as a box against the glow. There the glass is a layer of its own that runs
   the full width of the window and up to the top bar (behind the page title). */
html.site-customer .kc-page .jhc-sticky-top,
html.site-customer .kc-page .jhc-detail-topbar { background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
html.site-customer .kc-page .jhc-sticky-top::before,
html.site-customer .kc-page .jhc-detail-topbar::before {
  content: ''; position: absolute; top: -400px; bottom: 0; left: -100vw; right: -100vw; z-index: -1; pointer-events: none;
  background: rgba(11, 11, 12, 0.8); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
html.site-customer .kc-page .dialog .jhc-sticky-top::before,
html.site-customer .kc-page .dialog .jhc-detail-topbar::before { content: none; }
html.site-customer .jhc-thumb { background: repeating-linear-gradient(45deg, #151516, #151516 5px, #232326 5px, #232326 10px); color: #9d9a96; }
html.site-customer .jhc-dot { box-shadow: 0 0 0 2px #18181a; }

/* ── controls ── */
html.site-customer .input { background: #0d0d0e; border-color: #343437; }
html.site-customer .input:hover { border-color: #55555a; }
html.site-customer .input:focus-visible,
html.site-customer .input:focus { border-color: #ff7a1a; box-shadow: 0 0 0 3px rgba(255, 122, 26, 0.16); }
html.site-customer .input[readonly] { background: #151516; }
html.site-customer .btn-primary {
  background: linear-gradient(180deg, #ff8f33 0%, #f25c05 100%); color: #140a02;
  outline: none; box-shadow: 0 8px 22px -8px rgba(255, 106, 0, 0.65), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
html.site-customer .btn-primary:hover { background: linear-gradient(180deg, #ffa24f 0%, #ff6a12 100%); }
html.site-customer .btn-primary:active { background: linear-gradient(180deg, #f27a1f 0%, #d94f02 100%); }
html.site-customer .btn-primary:disabled { box-shadow: none; }
html.site-customer .btn.btn-notready,
html.site-customer .btn.btn-notready:hover,
html.site-customer .btn.btn-notready:active { background: #2a2a2d; color: #a3a09b; box-shadow: none; outline: 1px solid #3a3a3e; }
html.site-customer .btn-secondary { border-color: #3a3a3e; outline: none; background: rgba(255, 255, 255, 0.04); }
html.site-customer .btn-secondary:hover { background: rgba(255, 255, 255, 0.09); }
html.site-customer .jhc-scrolltop { color: #140a02; }
html.site-customer a.jhc-link { color: #7db7ff; }
html.site-customer a.jhc-link:hover { color: #a9cfff; }
html.site-customer ::-webkit-scrollbar-thumb { background: #3a3a3e; border-radius: 999px; }
html.site-customer ::-webkit-scrollbar { width: 10px; height: 8px; }
html.site-customer ::-webkit-scrollbar-track { background: transparent; }
