/* ==========================================================================
   HDPE ASIA — Design System 2026
   ระบบดีไซน์กลาง ใช้ร่วมกันทุกหน้า (โหลดต่อจาก style.css)
   แทนที่ site-redesign.css + home-redesign.css เดิม
   แนวทาง: บริษัทวิศวกรรม สะอาด อ่านง่าย น่าเชื่อถือ ไม่หวือหวา
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. DESIGN TOKENS
   -------------------------------------------------------------------------- */
:root {
    /* Ink & surfaces */
    --c-ink:          #0c2b44;   /* น้ำเงินเข้ม — หัวข้อ พื้นเข้ม */
    --c-ink-deep:     #082133;   /* เข้มสุด — footer */
    --c-ink-soft:     #16405d;   /* การ์ดบนพื้นเข้ม */
    --c-body:         #47606f;   /* เนื้อความ */
    --c-muted:        #5c7385;   /* ข้อความรอง */

    /* Brand */
    --c-teal:         #0a7a9e;   /* สีหลักสำหรับปุ่ม/ลิงก์ */
    --c-teal-dark:    #06617f;
    --c-teal-soft:    #e8f3f7;   /* พื้นอ่อน */
    --c-teal-light:   #9ad9ee;   /* ใช้บนพื้นเข้ม */
    --c-amber:        #a85f04;   /* สีเน้น ใช้อย่างประหยัด */
    --c-amber-soft:   #fdf3e2;
    --c-amber-dark:   #8f5203;

    /* Neutrals */
    --c-surface:      #ffffff;
    --c-surface-2:    #f4f8fa;
    --c-surface-3:    #eaf1f5;
    --c-line:         #dbe6ec;   /* เส้นขอบบาง */
    --c-line-strong:  #c3d5df;
    --c-line-dark:    #2f5570;   /* เส้นขอบบนพื้นเข้ม */

    /* Typography */
    --font-ui: "IBM Plex Sans Thai", "Kanit", system-ui, -apple-system, "Segoe UI", sans-serif;
    --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", monospace;

    /* Shape */
    --r-sm: 8px;
    --r-md: 12px;
    --r-lg: 16px;

    /* Elevation — เงาบางมาก ใช้เฉพาะตอน hover */
    --e-1: 0 1px 2px rgba(12, 43, 68, .05);
    --e-2: 0 10px 24px -12px rgba(12, 43, 68, .22);
    --e-3: 0 20px 44px -18px rgba(12, 43, 68, .26);

    /* Layout */
    --max-width: 1240px;

    /* ทับค่าเดิมของ style.css เพื่อให้ inline style var(--color-*) ตามมาด้วย */
    --color-primary:         #0c2b44;
    --color-secondary:       #0a7a9e;
    --color-secondary-hover: #06617f;
    --color-accent:          #a85f04;
    --color-accent-hover:    #8f5203;
    --color-dark-bg:         #082133;
    --color-light-bg:        #f4f8fa;
    --color-card-light:      #ffffff;
    --color-card-dark:       #16405d;
    --color-text-dark:       #0c2b44;
    --color-text-light:      #ffffff;
    --color-text-muted:      #47606f;
    --color-border:          #dbe6ec;
    --color-border-dark:     #2f5570;
    --border-radius-sm:      8px;
    --border-radius-md:      12px;
    --border-radius-lg:      16px;
    --shadow-sm:             0 1px 2px rgba(12, 43, 68, .05);
    --shadow-md:             0 10px 24px -12px rgba(12, 43, 68, .22);
    --shadow-lg:             0 20px 44px -18px rgba(12, 43, 68, .26);
    --shadow-glow:           none;
    --shadow-glow-accent:    none;
}

/* --------------------------------------------------------------------------
   2. BASE TYPOGRAPHY
   ภาษาไทยต้องการ line-height สูงกว่าอังกฤษ จึงตั้งฐานไว้ที่ 1.8
   -------------------------------------------------------------------------- */
html { font-size: 16px; }

body {
    font-family: var(--font-ui);
    font-weight: 400;
    line-height: 1.8;
    color: var(--c-body);
    background: var(--c-surface);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5 {
    font-family: var(--font-ui);
    color: var(--c-ink);
    font-weight: 600;
    letter-spacing: -.018em;
    line-height: 1.45;
}

h2 { font-size: clamp(1.6rem, 2.4vw, 2.25rem); }
h3 { font-size: clamp(1.15rem, 1.5vw, 1.35rem); line-height: 1.55; }

p { color: var(--c-body); font-weight: 400; }
strong, b { font-weight: 600; }   /* ไม่กำหนดสี เพื่อให้อ่านออกทั้งบนพื้นสว่างและพื้นเข้ม */

a { color: var(--c-teal); }
a:hover { color: var(--c-teal-dark); }

/* ตัวเลข/หน่วยเทคนิค อ่านง่ายขึ้นด้วยตัวเลขความกว้างเท่ากัน */
.stat-count, table td, .spec-value { font-variant-numeric: tabular-nums; }

.container { padding-left: 24px; padding-right: 24px; max-width: var(--max-width); }

/* Focus ที่มองเห็นชัดทุกองค์ประกอบที่กดได้ */
a:focus-visible,
button:focus-visible,
summary:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid var(--c-teal);
    outline-offset: 3px;
    border-radius: 4px;
}

.skip-link {
    position: fixed; top: -100px; left: 16px; z-index: 2000;
    background: #fff; color: var(--c-ink);
    padding: 12px 18px; border-radius: 0 0 var(--r-sm) var(--r-sm);
    box-shadow: var(--e-2); font-weight: 500;
}
.skip-link:focus { top: 0; }

/* --------------------------------------------------------------------------
   3. HEADER / NAVIGATION
   หัวเว็บสีขาว บาง เส้นคั่นบาง ๆ ไม่มีเงา — อ่านง่ายและดูเป็นทางการ
   -------------------------------------------------------------------------- */
.header,
.header.scrolled {
    background: rgba(255, 255, 255, .94);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--c-line);
    box-shadow: none;
}

.nav-container { height: 82px; }

.logo-img-container {
    height: 52px; width: 148px; min-width: 148px;
    padding: 0; background: transparent; box-shadow: none; border: 0;
}
.logo-img { height: 44px; width: auto; object-fit: contain; }

.nav-link {
    color: #294459;
    font-size: 14.5px;
    font-weight: 500;
    letter-spacing: .005em;
}
.nav-link:hover,
.nav-link.active { color: var(--c-teal); }
.nav-link::after { background: var(--c-teal); height: 2px; }

.nav-menu .btn-sm { font-size: 14px; padding: 11px 18px; }
.bar { background: var(--c-ink); }

@media (min-width: 1025px) {
    .nav { margin-left: auto; margin-right: 0; }
    .nav-menu { gap: 20px; align-items: center; }
}

/* --------------------------------------------------------------------------
   4. BUTTONS
   ทรงสี่เหลี่ยมมุมมน พื้นทึบ ไม่มีเงาเรืองแสง — ดูจริงจังแบบงานวิศวกรรม
   -------------------------------------------------------------------------- */
.btn {
    font-family: var(--font-ui);
    border-radius: var(--r-sm);
    min-height: 50px;
    font-weight: 500;
    font-size: 16px;
    letter-spacing: 0;
    box-shadow: none;
    transition: background-color .2s ease, color .2s ease, border-color .2s ease, transform .2s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: none; }

.btn-primary { background: var(--c-teal); color: #fff; border: 1px solid var(--c-teal); }
.btn-primary:hover { background: var(--c-teal-dark); border-color: var(--c-teal-dark); color: #fff; box-shadow: none; }

.btn-accent { background: var(--c-amber); color: #fff; border: 1px solid var(--c-amber); }
.btn-accent:hover { background: var(--c-amber-dark); color: #fff; border-color: var(--c-amber-dark); box-shadow: none; }

.btn-outline { background: #fff; color: var(--c-ink); border: 1.5px solid var(--c-line-strong); }
.btn-outline:hover { background: var(--c-ink); color: #fff; border-color: var(--c-ink); }

/* ปุ่มโครงบนพื้นสว่าง */
.btn-outline-white { background: #fff; color: var(--c-ink); border: 1.5px solid var(--c-line-strong); }
.btn-outline-white:hover { background: var(--c-ink); color: #fff; border-color: var(--c-ink); }

/* ปุ่มโครงบนพื้นเข้ม */
.section-dark .btn-outline-white,
.stats-bar .btn-outline-white,
.footer .btn-outline-white {
    background: transparent; color: #fff; border-color: rgba(255, 255, 255, .45);
}
.section-dark .btn-outline-white:hover,
.stats-bar .btn-outline-white:hover,
.footer .btn-outline-white:hover { background: #fff; color: var(--c-ink); border-color: #fff; }

.btn-sm { min-height: 42px; }
.new-badge { display: none; }

/* --------------------------------------------------------------------------
   5. HERO (หน้าแรก)
   เลย์เอาต์สองคอลัมน์: ข้อความซ้าย ภาพโครงการจริงขวา
   พื้นหลังมีลาย grid แบบแบบแปลนวิศวกรรมจาง ๆ
   -------------------------------------------------------------------------- */
.hero {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    min-height: 0;
    padding: 146px 0 76px;
    background: linear-gradient(180deg, #ffffff 0%, #f4f8fa 100%);
    color: var(--c-ink);
}

/* ลาย grid แบบแบบแปลน */
.hero::before {
    content: "";
    position: absolute; inset: 0; z-index: 0; pointer-events: none;
    background-image:
        linear-gradient(rgba(10, 122, 158, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(10, 122, 158, .07) 1px, transparent 1px);
    background-size: 52px 52px;
    background-position: center top;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 72%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 72%, transparent 100%);
}
.hero::after,
.hero-scroll,
.hero-corner,
.hero-glow-blob,
.hero-image-wrapper::before,
.hero-image-card::before,
.hero-image-card::after,
.hero-cert-chip,
.hero-badge-dot { display: none !important; }

.hero-grid {
    position: relative; z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, .95fr);
    gap: 62px;
    align-items: center;
    text-align: left;
}

.hero-content { min-width: 0; }
.hero-content,
.hero-content * { animation: none !important; opacity: 1; transform: none; }

/* Eyebrow — เส้นแนวตั้งสีฟ้า อ่านเหมือนหัวเรื่องเอกสารเทคนิค */
.hero-badge {
    display: inline-flex; align-items: center; gap: 7px;
    background: none; border: 0; border-left: 3px solid var(--c-teal);
    border-radius: 0; padding: 2px 0 2px 13px; margin-bottom: 22px;
    color: #076582; font-size: 14px; font-weight: 500; line-height: 1.7;
    box-shadow: none; backdrop-filter: none;
}

.hero-title {
    color: var(--c-ink);
    font-size: clamp(2.05rem, 3.2vw, 2.95rem);
    font-weight: 600;
    line-height: 1.4;
    letter-spacing: -.028em;
    margin-bottom: 0;
    text-shadow: none !important;
}
.hero-title span {
    color: var(--c-teal);
    background: none;
    -webkit-text-fill-color: currentColor;
    overflow-wrap: anywhere;
}
.hero-title .hero-title-sub {
    display: block;
    color: #35566c;
    -webkit-text-fill-color: #35566c;
    font-size: .565em;
    font-weight: 400;
    line-height: 1.62;
    letter-spacing: -.005em;
    margin-top: 16px;
}

.hero-desc {
    color: var(--c-body);
    font-size: 16.5px; line-height: 1.9;
    max-width: 585px;
    margin: 24px 0 28px;
}

/* จุดเด่นสินค้า — สองคอลัมน์ อ่านเร็ว ไม่ใช่การ์ด */
.hero-features {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 22px;
    margin: 0 0 32px;
    padding: 0; list-style: none;
}
.hero-features li,
.hero-features li.hero-feature-hl {
    display: flex; align-items: flex-start; gap: 10px;
    border: 0; background: none; padding: 0;
    font-size: 14.5px; line-height: 1.7; font-weight: 400;
    color: #43606f; box-shadow: none;
}
.hero-features li:hover,
.hero-features li.hero-feature-hl:hover { transform: none; background: none; }
.hero-features svg,
.hero-features li svg,
.hero-features li:nth-child(3) svg,
.hero-features li.hero-feature-hl svg {
    color: var(--c-teal); flex-shrink: 0; margin-top: 3px;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; justify-content: flex-start; }
.hero-actions .btn { min-height: 54px; box-shadow: none !important; }
.hero-link {
    color: #43606f !important;
    font-size: 14.5px;
    text-decoration: underline;
    text-underline-offset: 5px;
    text-decoration-color: var(--c-line-strong);
    border: 0;
    display: inline-flex; align-items: center; gap: 7px;
}
.hero-link:hover { color: var(--c-teal) !important; text-decoration-color: var(--c-teal); }
/* ลิงก์รองวางเป็นแถวเดียวใต้ปุ่มหลัก */
.hero-meta-links {
    display: flex; flex-wrap: wrap; align-items: center;
    gap: 10px 26px; margin-top: 20px;
}

/* ภาพโครงการจริง + การ์ดสเปกสินค้าต่อท้าย — เป็นก้อนเดียวกัน */
.hero-image-wrapper {
    position: relative;
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 0;
    width: 100%; max-width: none; min-width: 0;
    margin: 0; padding: 0;
    animation: none !important; transform: none !important;
    isolation: isolate;
    order: 0;
}

.project-hero {
    margin: 0; position: relative; min-width: 0;
    border: 1px solid var(--c-line);
    border-bottom: 0;
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    overflow: hidden;
    background: var(--c-ink);
    box-shadow: none;
}
.project-hero > img {
    display: block; width: 100%; height: auto;
    aspect-ratio: 4 / 3; object-fit: cover;
}
.project-hero figcaption {
    background: var(--c-ink); color: #fff;
    padding: 18px 22px; font-size: 15.5px; font-weight: 500; line-height: 1.6;
}
.project-hero figcaption span {
    display: block; color: #b9d2e0; font-size: 14px; font-weight: 400; margin-top: 5px;
}
.project-hero figcaption a { color: #9ad9ee; }

.hero-image-card {
    margin: 0; width: 100%; max-width: none; min-width: 0;
    background: #fff;
    border: 1px solid var(--c-line);
    border-top: 0;
    border-radius: 0 0 var(--r-lg) var(--r-lg);
    padding: 18px 22px;
    box-shadow: none; backdrop-filter: none;
    transform: none !important;
}
.hero-image-frame {
    display: grid !important;
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 18px; align-items: center;
    width: 100%; min-width: 0;
    background: none; border-radius: 0; overflow: visible;
    aspect-ratio: auto; min-height: 0; box-shadow: none;
}
.hero-image-frame > img {
    width: 78px; height: 100px; object-fit: cover;
    border-radius: var(--r-sm); flex-shrink: 0;
    transform: none !important;
}
.hero-image-card:hover .hero-image-frame img { transform: none !important; }

.hero-image-overlay {
    position: static; background: none; padding: 0; min-width: 0;
    text-align: left; color: var(--c-ink); text-shadow: none; filter: none;
}
.hero-image-overlay h3 {
    color: var(--c-ink); font-size: 17.5px; font-weight: 600;
    line-height: 1.5; margin: 0 0 4px; text-shadow: none;
}
.hero-image-overlay p { color: var(--c-body); font-size: 14px; line-height: 1.65; margin: 0; }

.hero-image-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.hero-image-tags span,
.hero-image-tags .tag-blue,
.hero-image-tags .tag-gold {
    font-family: var(--font-mono);
    font-size: 11.5px; font-weight: 500; letter-spacing: .01em;
    line-height: 1.5; padding: 4px 9px; border-radius: 5px;
    background: var(--c-teal-soft) !important;
    color: #075d78 !important;
    border: 1px solid #c9e3ec !important;
}
.hero-image-tags .tag-gold {
    background: var(--c-amber-soft) !important;
    color: #8a5203 !important;
    border-color: #ecd3a6 !important;
}

/* --------------------------------------------------------------------------
   6. CREDENTIAL STRIP — แถบมาตรฐาน/ความน่าเชื่อถือใต้ hero
   -------------------------------------------------------------------------- */
.cred-strip {
    background: #fff;
    border-top: 1px solid var(--c-line);
    border-bottom: 1px solid var(--c-line);
}
.cred-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 0;
}
.cred-item {
    display: flex; align-items: flex-start; gap: 13px;
    padding: 26px 26px 26px 0;
    border-right: 1px solid var(--c-line);
}
.cred-item:last-child { border-right: 0; }
.cred-item:not(:first-child) { padding-left: 26px; }
.cred-item svg { color: var(--c-teal); flex-shrink: 0; margin-top: 2px; }
.cred-item strong {
    display: block; color: var(--c-ink);
    font-size: 15px; font-weight: 600; line-height: 1.5;
}
.cred-item span {
    display: block; color: var(--c-muted);
    font-size: 13.5px; line-height: 1.6; margin-top: 2px;
}

/* --------------------------------------------------------------------------
   7. STATS BAR — ตัวเลขผลงานบนพื้นน้ำเงินเข้ม
   -------------------------------------------------------------------------- */
.stats-bar {
    position: relative; isolation: isolate; overflow: hidden;
    background: var(--c-ink);
    padding: 40px 0;
    border: 0;
}
.stats-bar::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image:
        linear-gradient(rgba(154, 217, 238, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(154, 217, 238, .08) 1px, transparent 1px);
    background-size: 48px 48px;
}
.stat-item { border-color: rgba(255, 255, 255, .16); }
.stat-item h3,
.stat-item .stat-count {
    color: #fff;
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 500;
    letter-spacing: -.02em;
    line-height: 1.25;
}
.stat-item p {
    color: #b3cddc; font-size: 14px; line-height: 1.6; margin-top: 6px;
}

/* --------------------------------------------------------------------------
   8. SECTION RHYTHM & TITLES
   หัวข้อชิดซ้าย มีเส้นสั้นสีฟ้าใต้หัวข้อ — อ่านเป็นเอกสาร ไม่ใช่โบรชัวร์
   -------------------------------------------------------------------------- */
.section { padding: 88px 0; }

.section-title-wrapper,
.section-title,
.about-head {
    text-align: left !important;
    max-width: 880px;
    margin-left: 0; margin-right: 0;
}
.section-title { margin-bottom: 14px; }
.section-title::after {
    margin-left: 0;
    width: 52px; height: 3px;
    background: var(--c-teal);
    border-radius: 2px;
}
.section-subtitle {
    color: var(--c-body);
    font-size: 16.5px; line-height: 1.9;
    max-width: 760px; margin-left: 0; margin-right: 0;
    text-align: left;
}

/* Eyebrow เหนือหัวข้อ */
.about-eyebrow,
.section-tag {
    display: inline-block;
    background: none; border: 0; padding: 0;
    color: var(--c-teal);
    font-size: 13.5px; font-weight: 600;
    letter-spacing: .09em; text-transform: uppercase;
    margin-bottom: 10px;
}

/* --------------------------------------------------------------------------
   9. CARDS — การ์ดทั้งหมดใช้ภาษาเดียวกัน: พื้นขาว เส้นขอบบาง ไม่มีเงา
   -------------------------------------------------------------------------- */
.about-card,
.app-card,
.feature-card,
.product-card,
.blog-card,
.trust-group,
.contact-card,
.contact-info-card,
.contact-form-card,
.calculator-panel,
.form-card {
    background: #fff !important;
    border: 1px solid var(--c-line) !important;
    border-radius: var(--r-md) !important;
    box-shadow: none !important;
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.app-card:hover,
.feature-card:hover,
.product-card:hover,
.blog-card:hover,
.trust-group:hover {
    border-color: var(--c-line-strong) !important;
    box-shadow: var(--e-2) !important;
    transform: translateY(-3px);
}

.feature-card::before,
.feature-card:hover::before { display: none; }

.app-card, .feature-card { padding: 30px; }
.app-card p, .feature-card p, .product-card p, .blog-card p {
    font-size: 15.5px; line-height: 1.85; color: var(--c-body);
}
.app-card h3, .feature-card h3 { color: var(--c-ink); margin-bottom: 10px; }
.product-card h3 { font-size: 1.2rem; color: var(--c-ink); }
.blog-card h3 { font-size: 1.15rem; color: var(--c-ink); }

.apps-grid, .features-grid, .product-grid { gap: 26px; }

/* ไอคอนการ์ด — กล่องสี่เหลี่ยมมุมมน พื้นอ่อน */
.app-icon,
.feature-icon-box {
    border-radius: var(--r-sm);
    background: var(--c-teal-soft);
    color: var(--c-teal);
    box-shadow: none;
}
.feature-card:hover .feature-icon-box { background: var(--c-teal); color: #fff; transform: none; }
.app-icon.ic-amber { background: var(--c-amber-soft); color: #a15c02; }
.app-icon.ic-green { background: #e7f4ee; color: #10704a; }
.app-icon.ic-cyan  { background: var(--c-teal-soft); color: var(--c-teal); }

/* แถบหัวการ์ดสินค้า/บทความ ใช้สีแบรนด์ใหม่ (แก้ที่ไฟล์ HTML แล้ว) */
.product-img-box > div[style*="linear-gradient"],
.blog-card > div[style*="linear-gradient"] {
    background: linear-gradient(135deg, #0a7a9e, #06617f) !important;
    color: #fff !important;
}

.about-text p { font-size: 16.5px; line-height: 1.95; }
.about-body { gap: 48px; }

/* Trust chips */
.trust-chip {
    border-radius: 999px; font-size: 13.5px;
    background: var(--c-surface-2); color: #33566a; border: 1px solid var(--c-line);
}
.trust-chip.hl { background: var(--c-teal-soft); color: #06617f; border-color: #c3e2ed; }

/* --------------------------------------------------------------------------
   10. TABLES — ตารางสเปกทางเทคนิค ต้องอ่านง่ายที่สุด
   -------------------------------------------------------------------------- */
.table-wrapper {
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
    box-shadow: none;
    overflow-x: auto;
}
table { font-size: 15px; line-height: 1.7; border-collapse: collapse; width: 100%; }
th {
    background: var(--c-ink) !important;
    color: #fff !important;
    font-weight: 500;
    letter-spacing: .01em;
    text-align: left;
}
td { color: #33526a !important; border-color: var(--c-line) !important; }
tbody tr:nth-child(even) { background: var(--c-surface-2); }
tbody tr:hover { background: var(--c-teal-soft); }

/* --------------------------------------------------------------------------
   11. FAQ
   -------------------------------------------------------------------------- */
.faq-item {
    border: 1px solid var(--c-line);
    border-radius: var(--r-md);
    background: #fff;
    box-shadow: none;
}
.faq-item[open] { border-color: var(--c-line-strong); background: #fff; }
.faq-item summary,
.faq-question { color: var(--c-ink); font-weight: 500; font-size: 16.5px; }
.faq-item summary::after { color: var(--c-teal); }
.faq-answer { color: var(--c-body); font-size: 15.5px; line-height: 1.9; }

/* --------------------------------------------------------------------------
   12. FORMS
   -------------------------------------------------------------------------- */
.form-group label { color: var(--c-ink); font-weight: 500; font-size: 15px; }
.form-group input,
.form-group textarea,
.form-group select {
    font-family: var(--font-ui);
    font-size: 16px;
    border: 1px solid #a9c1ce;
    border-radius: var(--r-sm);
    color: var(--c-ink);
    background: #fff;
}
.form-group input::placeholder,
.form-group textarea::placeholder { color: #8ba3b2; }
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    border-color: var(--c-teal);
    box-shadow: 0 0 0 3px rgba(10, 122, 158, .14);
    outline: none;
}

.contact-info-icon { background: var(--c-teal-soft); color: var(--c-teal); border-radius: var(--r-sm); }
.contact-info-text h3 { color: var(--c-ink); }
.contact-info-text p, .contact-info-text a { color: var(--c-body); }
.contact-info-text a:hover { color: var(--c-teal); }

/* --------------------------------------------------------------------------
   13. DARK SECTIONS
   -------------------------------------------------------------------------- */
.section-dark { background: var(--c-ink); }
.section-dark h1,
.section-dark h2,
.section-dark h3,
.section-dark h4 { color: #fff; text-shadow: none !important; }
.section-dark p,
.section-dark li,
.section-dark .section-subtitle { color: #c2d7e3 !important; }
.section-dark .section-tag,
.section-dark .about-eyebrow { color: var(--c-teal-light) !important; }
.section-dark .section-title::after { background: var(--c-teal-light); }
.section-dark .service-step-card {
    background: var(--c-ink-soft) !important;
    border: 1px solid var(--c-line-dark) !important;
    box-shadow: none !important;
}
.section-dark .service-step-card p { color: #cadde8 !important; }
.section-dark a:focus-visible { outline-color: var(--c-teal-light); }

/* พื้นเข้มทุกแบบ (รวมส่วนที่ตั้งพื้นด้วย inline style) ต้องใช้สีเน้นแบบอ่อน
   ไม่งั้น teal เข้มบนน้ำเงินเข้มจะได้คอนทราสต์แค่ ~3:1 */
.section-dark span[style*="var(--color-secondary)"],
.section[style*="var(--color-primary)"] span[style*="var(--color-secondary)"],
.calc-results-section span[style*="var(--color-secondary)"] {
    color: var(--c-teal-light) !important;
}
.calc-results-section a { color: var(--c-teal-light); }

/* ส่วน CTA ท้ายหน้า (พื้น gradient inline ใน HTML) */
.section[style*="linear-gradient(135deg, var(--color-primary)"] {
    position: relative; isolation: isolate; overflow: hidden;
    background: var(--c-ink) !important;
}
.section[style*="linear-gradient(135deg, var(--color-primary)"]::after {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image:
        linear-gradient(rgba(154, 217, 238, .07) 1px, transparent 1px),
        linear-gradient(90deg, rgba(154, 217, 238, .07) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 20%, #000 80%, transparent);
}

/* --------------------------------------------------------------------------
   14. PAGE HERO (หน้ารอง) — แถบหัวหน้าสีน้ำเงินเข้ม พร้อมลาย grid
   หน้ารองเดิมใช้ inline style padding-top: 140px จึงเจาะด้วย attribute selector
   -------------------------------------------------------------------------- */
.section.section-dark[style*="padding-top: 140px"] {
    position: relative; isolation: isolate; overflow: hidden;
    background: var(--c-ink) !important;
    padding-top: 152px !important;
    padding-bottom: 68px !important;
}
.section.section-dark[style*="padding-top: 140px"]::before {
    content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
    background-image:
        linear-gradient(rgba(154, 217, 238, .08) 1px, transparent 1px),
        linear-gradient(90deg, rgba(154, 217, 238, .08) 1px, transparent 1px);
    background-size: 48px 48px;
    -webkit-mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 82%, transparent);
    mask-image: linear-gradient(to bottom, transparent, #000 16%, #000 82%, transparent);
}
.section.section-dark[style*="padding-top: 140px"] h1 {
    font-size: clamp(1.9rem, 3vw, 2.7rem);
    line-height: 1.4; letter-spacing: -.028em;
}

/* --------------------------------------------------------------------------
   15. FOOTER
   -------------------------------------------------------------------------- */
.footer { background: var(--c-ink-deep); border-top: 1px solid #143a56; }
.footer h3 { color: #fff; font-size: 1.05rem; font-weight: 600; }
.footer .logo-img-container { background: #fff; border-radius: var(--r-sm); padding: 6px 12px !important; }
.footer .footer-brand p,
.footer .footer-links a,
.footer .footer-contact-list,
.footer .footer-contact-list li,
.footer .footer-contact-list span,
.footer .footer-bottom p,
.footer .footer-bottom-links a { color: #bed2df; font-size: 14.5px; line-height: 1.8; }
.footer .footer-brand p strong,
.footer .footer-contact-list strong { color: #fff; }
.footer .footer-links a:hover,
.footer .footer-bottom-links a:hover { color: #fff; text-decoration: underline; }
.footer .footer-contact-list svg { color: var(--c-teal-light); }
.footer .footer-bottom { border-top: 1px solid #143a56; }
.footer a[href*="line.me"].btn { color: #fff; background: #04833a !important; border-color: #04833a !important; }
.footer a[href*="line.me"].btn:hover { background: #036c2f !important; }
.footer a:focus-visible { outline-color: var(--c-teal-light); }

/* --------------------------------------------------------------------------
   16. CALCULATOR — ทำเครื่องหมายช่องที่ยังเป็นค่าตั้งต้น
   ไฮไลท์เฉพาะตัวช่องกรอก ไม่ระบายพื้นหลังทั้งบล็อก (ใช้กับข้อ 1-6 เท่านั้น)
   -------------------------------------------------------------------------- */
.calculator-panel .input-group.needs-adjustment > label {
    color: var(--c-ink);
}
.calculator-panel .input-group.needs-adjustment > label::after {
    content: "ปรับค่าได้";
    display: inline-block; margin-left: 8px; padding: 1px 8px;
    border-radius: 999px;
    background: var(--c-amber-soft); color: #7a4a03;
    border: 1px solid #ecd3a6;
    font-size: .68rem; font-weight: 500; line-height: 1.6; vertical-align: middle;
}
.calculator-panel .input-group.needs-adjustment input:not([type="range"]),
.calculator-panel .input-group.needs-adjustment select {
    border-color: #d9a24e;
    background: #fffdf7;
    box-shadow: inset 3px 0 0 var(--c-amber);
    transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.calculator-panel .input-group.needs-adjustment input:not([type="range"]):focus,
.calculator-panel .input-group.needs-adjustment select:focus {
    border-color: var(--c-teal);
    background: #fff;
    box-shadow: inset 3px 0 0 var(--c-teal), 0 0 0 3px rgba(10, 122, 158, .14);
}

/* แผงสรุปผลพื้นน้ำเงินเข้ม — สีตัวอักษรต้องเป็นโทนสว่าง
   (สีอำพันของปุ่มถูกทำให้เข้มขึ้นเพื่อผ่านคอนทราสต์บนพื้นขาว จึงใช้บนพื้นเข้มไม่ได้) */
.calc-results-section .metric-card.m-accent {
    border-color: rgba(245, 198, 125, .55);
    background: rgba(245, 198, 125, .10);
    box-shadow: none;
}
.calc-results-section .metric-card.m-accent .metric-label,
.calc-results-section .metric-card.m-accent .metric-val { color: #f7cd8b; }
.calc-results-section .metric-card.m-accent .metric-val span { color: #e8d3b2; }
.calc-results-section .metric-card.m-accent .metric-sub {
    color: #e3c79b;
    font-size: .74rem;
    white-space: normal;          /* เดิมตัดข้อความด้วย ellipsis จนอ่านไม่จบ */
    overflow: visible;
    text-overflow: clip;
    line-height: 1.55;
}

/* การ์ด "ม้วน & เศษคงเหลือ" คือตัวเลขที่ลูกค้าใช้สั่งของจริง
   จึงยกจำนวนม้วนขึ้นมาเป็นตัวเลขหลัก ขนาดเท่าการ์ดพื้นที่ */
.calc-results-section .metric-card.m-blue {
    border-color: rgba(154, 217, 238, .58);
    background: linear-gradient(135deg, rgba(10, 122, 158, .34), rgba(10, 122, 158, .16));
    box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
}
.calc-results-section .metric-card.m-blue .metric-label { color: #9ad9ee; }
.calc-results-section .metric-rows { gap: 9px; }
.calc-results-section .metric-rows > div:first-child {
    border-bottom-color: rgba(255, 255, 255, .16);
    padding-bottom: 8px;
}
.calc-results-section .metric-rows .k { color: #bcd7e5; font-size: .82rem; }
.calc-results-section .metric-rows .v { color: #9ad9ee; }
.calc-results-section .metric-rows .v span { color: #cfe3ee; }
/* จำนวนม้วน = ตัวเลขเด่นของการ์ดนี้ */
.calc-results-section .metric-rows > div:first-child .v {
    font-size: 2rem;
    line-height: 1.1;
    color: #ffffff;
}
.calc-results-section .metric-rows > div:first-child .v span {
    font-size: 1rem;
    color: #cfe3ee;
}

/* ภายในแผงสรุปผลพื้นเข้ม สีเน้นต้องเป็นอำพันโทนสว่าง
   ครอบคลุมไอคอนหัวข้อ, .recommend-title และตัวเลขความหนาที่แนะนำ
   ซึ่งทั้งหมดอ้าง var(--color-accent) */
.calc-results-section { --color-accent: #f7cd8b; }
.calc-results-section .recommend-text { color: #dbe7ef; }
.calc-results-section .recommend-text strong { color: #ffffff; }

/* แถบตัวเลขย่อยสี่ช่อง — ป้ายชื่อเดิมเป็นเทาเข้ม #64748b บนพื้นน้ำเงินเข้ม
   ได้คอนทราสต์แค่ 2.9:1 อ่านแทบไม่ออก */
.calc-results-section .mini-stat .mini-label { color: #a8c2d4; }
.calc-results-section .mini-stat .mini-val { color: #e6eff5; }
.calc-results-section .mini-stat .mini-val span { color: #b3cddc; }

/* --------------------------------------------------------------------------
   17. กันล้นแนวนอนบนมือถือ
   ลูกของ grid/flex มี min-width เป็น auto โดยปริยาย ทำให้ข้อความยาว ๆ
   (อีเมล ลิงก์ URL) ดันคอลัมน์กว้างเกินจอ จึงบังคับให้ย่อได้
   -------------------------------------------------------------------------- */
.hero-grid > *,
.contact-layout > *,
.about-body > *,
.footer-grid > *,
.apps-grid > *,
.features-grid > *,
.product-grid > *,
.stats-grid > *,
.contact-info-item > *,
.trust-groups > * { min-width: 0; }

.contact-info-text,
.contact-info-text p,
.contact-info-text a,
.footer-contact-list span,
.footer-contact-list a { overflow-wrap: anywhere; }

/* --------------------------------------------------------------------------
   18. RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 1150px) and (min-width: 1025px) {
    .nav-menu { gap: 13px; }
    .nav-link { font-size: 13.5px; }
    .logo-img-container { width: 124px; min-width: 124px; }
}

@media (max-width: 1024px) {
    .nav-container { height: 76px; }
    .nav-menu {
        top: 76px; background: #fff;
        border-bottom: 1px solid var(--c-line);
        max-height: calc(100dvh - 76px); overflow-y: auto;
    }
    .nav-link { color: var(--c-ink); font-size: 16px; }

    .hero { padding-top: 124px; }
    .hero-grid { grid-template-columns: 1fr 1fr; gap: 34px; }
    .hero-title { font-size: 2.1rem; }
    .hero-features { grid-template-columns: 1fr; }
    .hero-image-card { padding: 16px; }
    .hero-image-frame { grid-template-columns: 66px minmax(0, 1fr); gap: 13px; }
    .hero-image-frame > img { width: 66px; height: 88px; }

    .cred-grid { grid-template-columns: 1fr 1fr; }
    .cred-item:nth-child(2n) { border-right: 0; }
    .cred-item:nth-child(-n+2) { border-bottom: 1px solid var(--c-line); }

    .section.section-dark[style*="padding-top: 140px"] { padding-top: 122px !important; }
}

@media (max-width: 760px) {
    .container { padding-left: 20px; padding-right: 20px; }
    .section { padding: 56px 0; }
    h2 { font-size: 1.65rem; }

    .hero { padding: 108px 0 44px; background: var(--c-surface-2); }
    .hero::before { background-size: 36px 36px; }
    .hero-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
    .hero-title { font-size: clamp(1.8rem, 7.6vw, 2.4rem); letter-spacing: -.022em; }
    .hero-title .hero-title-sub { font-size: .62em; }
    .hero-title-break { display: none; }
    .hero-desc { font-size: 16px; margin-bottom: 24px; }
    .hero-features { grid-template-columns: 1fr; gap: 10px; }
    .hero-badge { font-size: 13px; }
    .hero-actions { width: 100%; }
    .hero-actions .btn { width: 100%; flex-basis: 100%; }
    .hero-meta-links { gap: 12px 20px; margin-top: 18px; }
    .project-hero > img { aspect-ratio: 4 / 3; }
    .project-hero figcaption { padding: 16px 18px; }
    .hero-image-overlay h3 { font-size: 16.5px; }

    .cred-grid { grid-template-columns: 1fr; }
    .cred-item { border-right: 0; border-bottom: 1px solid var(--c-line); padding: 20px 0; }
    .cred-item:not(:first-child) { padding-left: 0; }
    .cred-item:last-child { border-bottom: 0; }

    .stats-bar { padding: 32px 0; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 26px; }
    .stat-item { border: 0; }

    .about-body { grid-template-columns: 1fr; gap: 26px; }
    .apps-grid, .features-grid, .product-grid { grid-template-columns: 1fr !important; }
    .app-card, .feature-card { padding: 24px; }
    .section-title, .about-head { margin-bottom: 24px; }
    .section-subtitle { font-size: 16px; }

    table { font-size: 14px; }
    .footer-grid { grid-template-columns: 1fr !important; }
    .section [style*="minmax(280px"] { grid-template-columns: 1fr !important; }

    .section.section-dark[style*="padding-top: 140px"] {
        padding-top: 112px !important; padding-bottom: 48px !important;
    }
    .section.section-dark[style*="padding-top: 140px"]::before { background-size: 36px 36px; }
}

/* --------------------------------------------------------------------------
   19. MOTION PREFERENCES
   -------------------------------------------------------------------------- */
.animate-fade-in-up { opacity: 1; animation: none !important; }

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}
