/* หน้าคอร์สอบรม — ใช้ร่วมกับ landing-home.css (โหลด landing-home.css ก่อนเสมอ) */

.course-page {
    --hl: #f59e0b;
    --hl-soft: #fef3c7;
    --code-bg: #0b1730;
    --code-ink: #dbe4f5;
    --code-dim: #7b8aa8;
    --code-str: #fbbf24;
    --code-kw: #7dd3fc;
    --ok-bg: #dcfce7;
    --ok-ink: #15803d;
    --wait-bg: #eef1f6;
    --wait-ink: #5c6675;
}

.course-page .mono,
.course-page code {
    font-family: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
    font-size: .92em;
}

/* หน้านี้พื้นหลังส่วนหัวเป็นสีอ่อน แถบเมนูจึงต้องเป็นโทนสว่างตลอดเวลา */

.course-page .landing-nav {
    background: rgba(255, 255, 255, .92);
    border-bottom-color: var(--line);
}

.course-page .landing-nav .landing-brand {
    color: var(--ink);
}

.course-page .landing-nav .landing-brand strong {
    color: var(--accent);
}

.course-page .landing-nav .landing-links {
    color: var(--muted);
}

.course-page .landing-nav .landing-links a:hover {
    color: var(--ink);
}

.course-page .landing-nav .nav-toggle {
    border-color: #cfd6e2;
}

.course-page .landing-nav .nav-toggle span {
    background: var(--ink);
}

/* ---------- hero ---------- */

.course-hero {
    position: relative;
    padding: 124px 0 56px;
    background: linear-gradient(180deg, var(--accent-soft), #fff 72%);
    overflow: hidden;
}

/* ภาพประกอบพื้นหลัง: ข้อมูลในชีตไหลไปเป็นอีเมล PDF และนัดในปฏิทิน */
.course-hero::before {
    content: "";
    position: absolute;
    inset: 0;
    background: url("/images/course/apps-script-texture.svg") no-repeat center center / cover;
    opacity: .5;
    pointer-events: none;
}

.course-hero > .container {
    position: relative;
    z-index: 1;
}

@media (max-width: 1020px) {
    .course-hero::before {
        opacity: .3;
        background-position: top center;
    }
}

.course-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
    gap: 48px;
    align-items: center;
}

@media (max-width: 1020px) {
    .course-hero {
        padding-top: 110px;
    }

    .course-hero-grid {
        grid-template-columns: 1fr;
        gap: 36px;
    }
}

.course-eyebrow {
    display: inline-block;
    font-size: .82rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}

.fxbar {
    display: grid;
    grid-template-columns: auto 1fr;
    border: 1px solid var(--line);
    background: #fff;
    border-radius: var(--radius-sm);
    overflow: hidden;
    margin: 16px 0 20px;
    box-shadow: var(--shadow-sm);
}

.fxbar .fx {
    display: flex;
    align-items: flex-start;
    padding: 14px 16px;
    border-right: 1px solid var(--line);
    color: var(--muted);
    font-style: italic;
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: 1.15rem;
}

.fxbar h1 {
    margin: 0;
    padding: 12px 20px 16px;
    font-size: clamp(1.9rem, 4.4vw, 2.9rem);
    font-weight: 700;
    letter-spacing: -.01em;
}

.fxbar h1 .hl {
    background: linear-gradient(transparent 58%, var(--hl-soft) 58%);
    padding-inline: 3px;
}

.course-lede {
    color: var(--muted);
    font-size: 1.06rem;
    max-width: 34rem;
}

.course-lede strong {
    color: var(--ink);
}

/* ราคา */

.price-row {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 10px 14px;
    margin-top: 22px;
}

.price-now {
    font-size: 2.4rem;
    font-weight: 700;
    line-height: 1;
    color: var(--ink);
}

.price-now span {
    font-size: 1rem;
    font-weight: 500;
    color: var(--muted);
}

.price-was {
    color: var(--muted);
    text-decoration: line-through;
}

.price-tag {
    background: var(--hl-soft);
    color: #92400e;
    border-radius: 999px;
    padding: 3px 12px;
    font-size: .88rem;
    font-weight: 600;
}

.seat-note {
    margin-top: 6px;
    color: var(--muted);
    font-size: .95rem;
}

.seat-note b {
    color: var(--ink);
}

.course-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.facts {
    display: grid;
    grid-template-columns: repeat(4, auto);
    justify-content: start;
    margin-top: 30px;
    border-top: 1px solid var(--line);
}

.facts div {
    padding: 14px 24px 0 0;
    margin-right: 24px;
    border-right: 1px solid var(--line);
}

.facts div:last-child {
    border-right: 0;
    margin-right: 0;
    padding-right: 0;
}

.facts b {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.facts span {
    font-size: .85rem;
    color: var(--muted);
}

@media (max-width: 560px) {
    .facts {
        grid-template-columns: repeat(2, 1fr);
    }

    .facts div {
        border-right: 0;
        margin-right: 0;
    }
}

/* ---------- demo sheet ---------- */

.demo {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow-md);
}

.demo-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding: 10px 14px;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--line);
    font-size: .92rem;
}

.demo-head .file {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 500;
}

.demo-head .file i {
    width: 11px;
    height: 11px;
    border-radius: 3px;
    background: var(--accent);
    display: inline-block;
}

.run-btn {
    border: 0;
    border-radius: 8px;
    background: var(--accent);
    color: #fff;
    font-family: inherit;
    font-size: .9rem;
    font-weight: 600;
    padding: 7px 16px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.run-btn:hover {
    background: var(--accent-dark);
}

.run-btn[disabled] {
    opacity: .65;
    cursor: progress;
}

.sheet-scroll {
    overflow-x: auto;
}

table.sheet {
    border-collapse: collapse;
    width: 100%;
    min-width: 430px;
    font-size: .9rem;
    font-variant-numeric: tabular-nums;
}

.sheet th,
.sheet td {
    border: 1px solid var(--line);
    padding: 6px 10px;
    text-align: left;
    white-space: nowrap;
}

.sheet thead th,
.sheet th.rn {
    background: var(--bg-alt);
    color: var(--muted);
    font-family: "JetBrains Mono", Consolas, monospace;
    font-weight: 400;
    font-size: .78rem;
    text-align: center;
}

.sheet th.rn {
    width: 32px;
}

.sheet tr.hdr td {
    font-weight: 600;
}

.sheet td.num {
    text-align: right;
}

.sheet td.email {
    color: var(--muted);
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: .78rem;
}

.sheet tr.active td {
    background: var(--hl-soft);
}

.chip {
    display: inline-block;
    border-radius: 999px;
    padding: 1px 10px;
    font-size: .78rem;
    font-weight: 600;
}

.chip.wait {
    background: var(--wait-bg);
    color: var(--wait-ink);
}

.chip.ok {
    background: var(--ok-bg);
    color: var(--ok-ink);
}

.code {
    margin: 0;
    background: var(--code-bg);
    color: var(--code-ink);
    font-family: "JetBrains Mono", "Cascadia Mono", Consolas, monospace;
    font-size: .8rem;
    line-height: 1.75;
    padding: 14px 0;
    overflow-x: auto;
}

.code .ln {
    display: block;
    padding-inline: 16px;
    white-space: pre;
}

.code .ln::before {
    content: attr(data-n);
    display: inline-block;
    width: 1.5em;
    margin-right: 12px;
    text-align: right;
    color: var(--code-dim);
}

.code .ln.on {
    background: rgba(125, 211, 252, .12);
    box-shadow: inset 3px 0 0 var(--code-kw);
}

.code .k {
    color: var(--code-kw);
}

.code .s {
    color: var(--code-str);
}

.code .c {
    color: var(--code-dim);
}

.log {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 9px 16px;
    border-top: 1px solid var(--line);
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: .78rem;
    color: var(--muted);
    min-height: 2.4em;
}

.log b {
    color: var(--ink);
    font-weight: 600;
}

/* ---------- sections ---------- */

.course-section {
    padding: 72px 0;
    border-top: 1px solid var(--line);
}

.course-section.alt {
    background: var(--bg-alt);
}

.sec-head {
    max-width: 44rem;
    margin-bottom: 36px;
}

.sec-head h2 {
    margin: 8px 0 10px;
    font-size: clamp(1.5rem, 3vw, 2rem);
}

.sec-head p {
    margin: 0;
    color: var(--muted);
}

/* ก่อน → หลัง */

.swap {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}

.swap-row {
    display: grid;
    grid-template-columns: 1fr 48px 1fr;
    border-top: 1px solid var(--line);
}

.swap-row:first-child {
    border-top: 0;
}

.swap-row > div {
    padding: 18px 22px;
}

.swap-row .arrow {
    display: grid;
    place-items: center;
    padding: 0;
    color: var(--accent);
    background: var(--bg-alt);
    border-inline: 1px solid var(--line);
}

.swap-row .before {
    color: var(--muted);
}

.swap-row .after b {
    font-weight: 600;
}

.swap-row .svc {
    display: block;
    margin-top: 4px;
    color: var(--accent);
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: .76rem;
}

@media (max-width: 720px) {
    .swap-row {
        grid-template-columns: 1fr;
    }

    .swap-row .arrow {
        border-inline: 0;
        border-block: 1px solid var(--line);
        padding: 2px;
    }

    .swap-row .before::before {
        content: "ตอนนี้ — ";
        font-weight: 600;
    }
}

/* labs */

.labs {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 17rem), 1fr));
    gap: 16px;
}

.lab-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 20px 22px;
    display: grid;
    gap: 6px;
    align-content: start;
}

.lab-card .ref {
    display: flex;
    justify-content: space-between;
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: .78rem;
    color: var(--muted);
}

.lab-card .ref em {
    font-style: normal;
    color: var(--accent);
}

.lab-card h3 {
    margin: 0;
    font-size: 1.05rem;
}

.lab-card p {
    margin: 0;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.6;
}

.lab-card.project {
    background: var(--accent-soft);
    border-color: #d7e2fb;
}

.lab-card.project .ref em {
    color: #92400e;
    background: var(--hl-soft);
    padding-inline: 6px;
    border-radius: 4px;
}

/* ตารางเรียน */

.days {
    display: grid;
    gap: 44px;
}

.day {
    display: grid;
    grid-template-columns: 14rem 1fr;
    gap: 36px;
}

@media (max-width: 860px) {
    .day {
        grid-template-columns: 1fr;
        gap: 14px;
    }
}

.day-title .big {
    display: block;
    font-size: 1.6rem;
    font-weight: 700;
    line-height: 1.2;
}

.day-title p {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: .95rem;
}

.slots {
    list-style: none;
    margin: 0;
    padding: 0;
    border-top: 1px solid var(--line);
}

.slot {
    display: grid;
    grid-template-columns: 7.5rem 1fr;
    gap: 18px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
}

.slot time {
    color: var(--muted);
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: .84rem;
    font-variant-numeric: tabular-nums;
}

.slot h3 {
    margin: 0;
    font-size: 1rem;
}

.slot span {
    color: var(--muted);
    font-size: .92rem;
}

.slot .tag {
    color: var(--accent);
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: .76rem;
}

.slot.brk {
    padding: 7px 0;
}

.slot.brk div {
    color: var(--muted);
    font-size: .9rem;
}

@media (max-width: 520px) {
    .slot {
        grid-template-columns: 1fr;
        gap: 2px;
    }
}

/* flow ของ final project */

.flow {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 18px;
    counter-reset: step;
}

.flow li {
    counter-increment: step;
    display: grid;
    gap: 5px;
    align-content: start;
    padding-top: 16px;
    border-top: 3px solid var(--accent);
}

.flow li:nth-child(4) {
    border-top-color: var(--hl);
}

.flow li::before {
    content: counter(step);
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: .78rem;
    color: var(--muted);
}

.flow li b {
    font-size: 1rem;
}

.flow li .svc {
    color: var(--accent);
    font-family: "JetBrains Mono", Consolas, monospace;
    font-size: .76rem;
}

.flow li span.d {
    color: var(--muted);
    font-size: .88rem;
    line-height: 1.5;
}

@media (max-width: 960px) {
    .flow {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 460px) {
    .flow {
        grid-template-columns: 1fr;
    }
}

/* เหมาะกับใคร / เตรียมตัว */

.fit {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 44px;
}

@media (max-width: 800px) {
    .fit {
        grid-template-columns: 1fr;
        gap: 30px;
    }
}

.ticks {
    list-style: none;
    padding: 0;
    margin: 14px 0 0;
    display: grid;
    gap: 10px;
}

.ticks li {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 10px;
}

.ticks li::before {
    content: "✓";
    color: var(--accent);
    font-weight: 700;
    line-height: 1.7;
}

/* ช่องติ๊กวาดด้วย CSS — ตัวอักษร □ ของฟอนต์บางและเล็กเกินไป */
.ticks.prep li::before {
    content: "";
    width: 17px;
    height: 17px;
    margin-top: 6px;
    border: 2px solid #c3ccdc;
    border-radius: 5px;
    background: #fff;
}

.note {
    margin-top: 18px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    background: var(--accent-soft);
    color: var(--muted);
    font-size: .94rem;
}

.note b {
    color: var(--ink);
}

/* การจองที่นั่ง */

.book {
    display: grid;
    grid-template-columns: 1.05fr 1fr;
    border: 2px solid var(--ink);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
}

@media (max-width: 860px) {
    .book {
        grid-template-columns: 1fr;
    }
}

.book-main {
    padding: 32px;
    display: grid;
    gap: 16px;
    align-content: start;
}

.book-main .includes {
    display: grid;
    gap: 6px;
    font-size: .97rem;
}

.book-steps {
    border-left: 1px solid var(--line);
    padding: 32px;
    background: var(--bg-alt);
}

@media (max-width: 860px) {
    .book-steps {
        border-left: 0;
        border-top: 1px solid var(--line);
    }
}

.book-steps ol {
    margin: 12px 0 0;
    padding-left: 20px;
    display: grid;
    gap: 10px;
}

.book-steps li span {
    color: var(--muted);
    font-size: .92rem;
}

.terms {
    margin-top: 26px;
    color: var(--muted);
    font-size: .9rem;
    line-height: 1.7;
}

.terms b {
    color: var(--ink);
}

/* FAQ */

.faq {
    max-width: 50rem;
    border-top: 1px solid var(--line);
}

.faq details {
    border-bottom: 1px solid var(--line);
}

.faq summary {
    position: relative;
    cursor: pointer;
    list-style: none;
    padding: 17px 40px 17px 0;
    font-weight: 600;
    font-size: 1.05rem;
}

.faq summary::-webkit-details-marker {
    display: none;
}

.faq summary::after {
    content: "+";
    position: absolute;
    right: 6px;
    top: 14px;
    font-size: 1.4rem;
    color: var(--muted);
}

.faq details[open] summary::after {
    content: "−";
}

.faq p {
    margin: 0;
    padding-bottom: 20px;
    color: var(--muted);
    max-width: 42rem;
}

.legal {
    margin-top: 40px;
    color: var(--muted);
    font-size: .82rem;
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
}

/* ปุ่ม CTA บนแถบเมนูยาวกว่าหน้าแรก จอเล็กจึงเหลือแค่ไอคอน ไม่ให้ทับชื่อแบรนด์ */

.course-page .nav-cta {
    white-space: nowrap;
}

@media (max-width: 520px) {
    .course-page .nav-cta span {
        display: none;
    }

    .course-page .landing-brand span {
        font-size: .95rem;
    }
}


/* ภาพประกอบ flow ของระบบ */

.course-figure {
    margin: 0 0 34px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: linear-gradient(180deg, #fff, var(--accent-soft));
    padding: 8px 8px 0;
    overflow: hidden;
}

.course-figure img {
    width: 100%;
    height: auto;
    border-radius: calc(var(--radius) - 6px);
}

.course-figure figcaption {
    padding: 12px 14px 14px;
    color: var(--muted);
    font-size: .92rem;
}


/* ภาพประกอบในส่วนหัว */

.hero-art {
    width: 100%;
    height: auto;
}

/* ชีตจำลองที่กดรันได้ ย้ายมาเป็นเซคชันของตัวเอง */

#demo .demo {
    max-width: 780px;
    margin-inline: auto;
}


/* ชื่อวิชา ต้องอ่านออกตั้งแต่วินาทีแรกว่าคอร์สอะไร */

.course-subject {
    margin: 0 0 12px;
    font-size: clamp(1.25rem, 2.4vw, 1.7rem);
    font-weight: 500;
    color: var(--ink);
}

.course-subject strong {
    font-weight: 700;
    background: linear-gradient(120deg, var(--accent), var(--violet));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}


/* กันคำโดดขึ้นบรรทัดใหม่ในหัวเรื่อง */

.fxbar h1 .nw {
    white-space: nowrap;
}

@media (max-width: 680px) {
    .fxbar h1 .nw {
        white-space: normal;
    }
}


/* ---------- ส่วนหัวเวอร์ชันจัดใหม่ ---------- */

.hero-pill {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 7px 16px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #fff;
    box-shadow: var(--shadow-sm);
    font-size: .9rem;
    font-weight: 600;
    color: var(--ink);
}

.hero-pill i {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #16a34a;
    box-shadow: 0 0 0 4px rgba(22, 163, 74, .16);
}

.course-title {
    margin: 20px 0 10px;
    font-size: clamp(2.1rem, 4.4vw, 3.3rem);
    font-weight: 700;
    line-height: 1.16;
    letter-spacing: -.015em;
}

.course-title .hl {
    background: linear-gradient(transparent 62%, #ddd6fe 62%, #ddd6fe 94%, transparent 94%);
    padding-inline: 3px;
}

.course-title .nw {
    white-space: nowrap;
}

@media (max-width: 680px) {
    .course-title .nw {
        white-space: normal;
    }
}

.course-hero-copy .course-lede {
    font-size: 1.05rem;
    max-width: 32rem;
}

/* การ์ดราคา: จุดตัดสินใจของหน้า */

.offer {
    margin-top: 26px;
    max-width: 33rem;
    padding: 22px 24px 20px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #fff;
    box-shadow: var(--shadow-md);
    display: grid;
    gap: 12px;
}

.offer .price-row {
    margin-top: 0;
}

.offer .seat-note {
    margin: 0;
}

.offer .course-actions {
    margin-top: 4px;
}

.offer-fine {
    margin: 0;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .86rem;
    line-height: 1.6;
}

.course-hero-copy .facts {
    margin-top: 28px;
}

/* ภาพประกอบใหญ่ขึ้นและล้นออกขอบขวาเล็กน้อย */

@media (min-width: 1021px) {
    .hero-art {
        width: 114%;
        max-width: none;
        margin-right: -14%;
    }
}

/* ---------- หน้ารวมคอร์ส /course ---------- */

.index-hero {
    padding: 132px 0 56px;
    text-align: left;
}

.index-hero .course-title {
    max-width: 22ch;
}

.index-lede {
    max-width: 44rem;
    font-size: 1.08rem;
}

.ccards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr));
    gap: 22px;
}

.ccard {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 28px 28px 24px;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
}

.ccard h3 {
    margin: 0;
    font-size: 1.45rem;
    line-height: 1.3;
}

.ccard h3 a {
    color: inherit;
}

.ccard h3 a:hover {
    color: var(--accent);
}

.ccard > p {
    margin: 0;
    color: var(--muted);
    line-height: 1.65;
}

.ccard-badge {
    align-self: flex-start;
    padding: 5px 14px;
    border-radius: 999px;
    background: var(--bg-alt);
    color: var(--muted);
    font-size: .84rem;
    font-weight: 600;
}

.ccard-badge.open {
    background: #dcfce7;
    color: #15803d;
}

.ccard-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ccard-chips span {
    padding: 5px 12px;
    border: 1px solid var(--line);
    border-radius: 999px;
    font-size: .86rem;
    color: var(--muted);
}

.ccard-foot {
    margin-top: auto;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    display: grid;
    gap: 14px;
}

.ccard-foot .price-row {
    margin-top: 0;
}

.ccard-foot .course-actions {
    margin-top: 0;
}

.ccard-note {
    margin: 0;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.6;
}

.ccard.soon {
    background: linear-gradient(180deg, #fff, var(--bg-alt));
    box-shadow: var(--shadow-sm);
}

.ccard.soon h3 {
    color: var(--muted);
}

/* หน้ารวม: ลายพื้นหลังเบาลง และเลี่ยงไม่ให้ชิป "ส่งแล้ว" ในลายมาโผล่มุมขวาบน */
.index-hero::before {
    opacity: .32;
    background-position: left bottom;
}

/* รูปปกการ์ดคอร์ส */

.ccard {
    padding: 0 0 24px;
    overflow: hidden;
}

.ccard > *:not(.ccard-media) {
    margin-inline: 28px;
}

.ccard-media {
    display: block;
    margin: 0 0 4px;
    background: var(--bg-alt);
    aspect-ratio: 16 / 9;
    overflow: hidden;
}

.ccard-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .3s ease;
}

a.ccard-media:hover img {
    transform: scale(1.03);
}

@media (prefers-reduced-motion: reduce) {
    .ccard-media img {
        transition: none;
    }
}

.ccard > .ccard-badge {
    margin-top: 20px;
}

/* ---------- หน้าลงทะเบียน /course/{slug}/register ---------- */

.reg-page {
    padding: 112px 0 72px;
    background: linear-gradient(180deg, var(--accent-soft), #fff 46%);
    min-height: 70vh;
}

.reg-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 340px;
    gap: 36px;
    align-items: start;
}

@media (max-width: 900px) {
    .reg-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }
}

.reg-back {
    display: block;
    width: fit-content;
    margin-bottom: 14px;
    color: var(--muted);
    font-size: .95rem;
    text-decoration: none;
}

.reg-back:hover {
    color: var(--accent);
}

.reg-form-col > .course-eyebrow {
    display: block;
}

.reg-title {
    margin: 6px 0 12px;
    font-size: clamp(1.6rem, 3.4vw, 2.2rem);
    line-height: 1.25;
    letter-spacing: -.01em;
}

.reg-lede {
    margin: 0 0 22px;
    color: var(--muted);
    line-height: 1.7;
}

.reg-note {
    margin: 0 0 22px;
    padding: 14px 16px;
    border-radius: var(--radius-sm);
    line-height: 1.65;
    font-size: .96rem;
}

.reg-note.warn {
    background: #fff7ed;
    border: 1px solid #fed7aa;
    color: #7c2d12;
}

.reg-note.error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.reg-note ul {
    margin: 6px 0 0;
    padding-left: 18px;
}

/* ---- แบบฟอร์ม ---- */

.reg-form {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 26px 24px 28px;
}

@media (max-width: 560px) {
    .reg-form {
        padding: 20px 16px 24px;
    }
}

.reg-legend {
    margin: 26px 0 14px;
    font-size: 1.02rem;
    font-weight: 600;
    color: var(--ink);
    padding-bottom: 8px;
    border-bottom: 1px solid var(--line);
}

.reg-form .reg-legend:first-of-type {
    margin-top: 0;
}

.reg-legend small {
    font-weight: 400;
    color: var(--muted);
}

.reg-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 18px;
}

@media (max-width: 560px) {
    .reg-row {
        grid-template-columns: 1fr;
    }
}

.reg-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.reg-field label {
    font-size: .93rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.reg-field label i {
    color: #dc2626;
    font-style: normal;
}

.reg-field input,
.reg-field select,
.reg-field textarea {
    font: inherit;
    color: var(--ink);
    background: #fff;
    border: 1px solid #cfd6e2;
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    width: 100%;
    transition: border-color .15s, box-shadow .15s;
}

.reg-field textarea {
    resize: vertical;
    line-height: 1.6;
}

.reg-field input:focus,
.reg-field select:focus,
.reg-field textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, .14);
}

.reg-field input::placeholder,
.reg-field textarea::placeholder {
    color: #9aa4b4;
}

.reg-hint {
    margin-top: 5px;
    font-size: .84rem;
    color: var(--muted);
    line-height: 1.5;
}

.reg-error {
    display: block;
    margin-top: 5px;
    font-size: .86rem;
    color: #dc2626;
}

.reg-error:empty {
    display: none;
}

.reg-field input.input-validation-error,
.reg-field select.input-validation-error,
.reg-field textarea.input-validation-error {
    border-color: #f1a3a3;
    background: #fffafa;
}

.reg-check {
    display: flex;
    gap: 11px;
    align-items: flex-start;
    margin: 20px 0 6px;
    padding: 14px 16px;
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: .89rem;
    line-height: 1.6;
    color: var(--muted);
    cursor: pointer;
}

.reg-check input {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex: 0 0 auto;
    accent-color: var(--accent);
}

.reg-submit {
    width: 100%;
    margin-top: 18px;
    justify-content: center;
    font-size: 1.02rem;
    padding: 14px 20px;
}

.reg-fine {
    margin: 12px 0 0;
    font-size: .88rem;
    color: var(--muted);
    line-height: 1.6;
}

.reg-fine.center {
    text-align: center;
    margin-top: 20px;
}

.reg-fine a {
    color: var(--accent);
}

/* ---- การ์ดสรุปคอร์ส ---- */

.reg-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 22px 20px;
}

.reg-summary .reg-card {
    position: sticky;
    top: 92px;
}

@media (max-width: 900px) {
    .reg-summary .reg-card {
        position: static;
    }
}

.reg-card-eyebrow {
    margin: 0 0 4px;
    font-size: .78rem;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--accent);
    font-weight: 600;
}

.reg-card h2 {
    margin: 0 0 16px;
    font-size: 1.12rem;
    line-height: 1.4;
}

.reg-facts {
    margin: 0;
    display: grid;
    gap: 10px;
}

.reg-facts > div {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 10px;
    align-items: baseline;
}

.reg-facts dt {
    color: var(--muted);
    font-size: .86rem;
}

.reg-facts dd {
    margin: 0;
    font-size: .94rem;
    line-height: 1.5;
}

.reg-price {
    margin: 18px 0 6px;
}

.reg-seats {
    margin: 0 0 14px;
    font-size: .92rem;
    color: var(--muted);
}

.reg-includes {
    margin: 0;
    padding: 14px 0 0;
    border-top: 1px solid var(--line);
    list-style: none;
    display: grid;
    gap: 8px;
}

.reg-includes li {
    position: relative;
    padding-left: 22px;
    font-size: .9rem;
    color: var(--muted);
    line-height: 1.5;
}

.reg-includes li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--ok-ink);
    font-weight: 700;
}

/* ---- หน้ายืนยันหลังลงทะเบียน ---- */

.reg-done {
    max-width: 920px;
}

.reg-done-head {
    text-align: center;
    margin-bottom: 28px;
}

.reg-tick {
    display: inline-grid;
    place-items: center;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: var(--ok-bg);
    color: var(--ok-ink);
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 14px;
}

.reg-done-head h1 {
    margin: 0 0 10px;
    font-size: clamp(1.5rem, 3.2vw, 2rem);
}

.reg-done-head p {
    margin: 0 auto;
    max-width: 620px;
    color: var(--muted);
    line-height: 1.7;
}

.reg-code {
    margin-top: 12px !important;
    color: var(--ink) !important;
}

.reg-code b {
    background: var(--hl-soft);
    padding: 3px 10px;
    border-radius: 999px;
}

.reg-done-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 22px;
    align-items: start;
}

@media (max-width: 860px) {
    .reg-done-grid {
        grid-template-columns: 1fr;
    }
}

.reg-steps {
    margin: 0;
    padding-left: 20px;
    display: grid;
    gap: 16px;
}

.reg-steps li {
    line-height: 1.6;
}

.reg-steps b {
    display: block;
}

.reg-steps span {
    display: block;
    margin-top: 4px;
    font-size: .9rem;
    color: var(--muted);
}

.reg-steps a {
    color: var(--accent);
}

.reg-bank {
    background: #f7f9fc;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    color: var(--ink) !important;
}

.reg-bank b {
    display: inline;
    font-size: 1.05rem;
    letter-spacing: .02em;
}
