/* ลงนามเอกสาร (/sign · /sign/{ฉบับ}) — รายการ · กรอบเซ็นชื่อ · ผลการลงนาม */

.crumb { margin: 0 0 8px; }
.crumb a { display: inline-flex; align-items: center; gap: 4px; min-height: 44px; color: var(--brand); text-decoration: none; font-weight: 600; }
.page-head__eyebrow { margin: 0; color: var(--accent); font-family: var(--font-display); font-weight: 600; font-size: .9rem; }

/* ── บังคับ (สมัครออนไลน์) / ไม่บังคับ (สมัครที่วิทยาลัย) ── */
.signintro { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 14px; padding: 12px 14px; border-radius: var(--r); font-weight: 500; }
.signintro .icon { flex: 0 0 auto; margin-top: 3px; }
.signintro.is-required { background: var(--maroon-soft); color: var(--maroon); }
.signintro.is-optional { background: var(--green-soft); color: var(--green); }

/* ── รายการเอกสาร ── */
.signlist { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 12px; }
.signitem__link {
    display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: start;
    padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none;
}
.signitem__link:hover { border-color: var(--line); }
.signitem__link:focus-visible { outline: none; box-shadow: var(--focus); }
.signitem__num {
    display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%;
    background: var(--brand-soft); color: var(--brand); font-family: var(--font-display); font-weight: 700;
}
.signitem.is-done .signitem__num { background: var(--green); color: #fff; }
.signitem__text { display: grid; gap: 4px; min-width: 0; }
.signitem__title { font-weight: 600; font-size: 1.05rem; }
.signitem__sum { color: var(--ink-2); font-size: .9rem; }
.signitem__who { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.signitem__go { grid-column: 2; display: inline-flex; align-items: center; gap: 2px; color: var(--brand); font-weight: 600; font-size: .95rem; }

.chip { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: 999px; font-size: .8rem; line-height: 1.6; }
.chip--done { background: var(--green-soft); color: var(--green); }
.chip--todo { background: var(--maroon-soft); color: var(--maroon); }

.signnote { padding: 16px; border-radius: var(--r-lg); background: var(--surface-2); color: var(--ink-2); font-size: .9rem; }
.signnote__title { margin: 0 0 6px; font-size: 1rem; color: var(--ink); }
.signnote ul { margin: 0; padding-left: 1.2em; display: grid; gap: 4px; }

/* ── ผลการลงนาม ── */
.signmsg { display: flex; gap: 8px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); margin-bottom: 14px; font-weight: 600; }
.signmsg--ok { background: var(--green-soft); color: var(--green); }
.signmsg--error { background: var(--maroon-soft); color: var(--maroon); }

/* ── กรอบลงนาม ── */
.sigcard {
    margin: 0 0 16px; padding: 16px; border-radius: var(--r-lg); background: var(--surface);
    border: 1px solid var(--line-soft); box-shadow: var(--shadow-sm); scroll-margin-top: 80px;
}
.sigcard.is-done { border-color: color-mix(in srgb, var(--green) 35%, var(--line)); }
.sigcard__title { margin: 0 0 10px; font-size: 1.05rem; display: grid; }
.sigcard__name { font-family: var(--font-body); font-weight: 500; color: var(--ink-2); font-size: .95rem; }
.sigcard__note { margin: 0 0 10px; color: var(--maroon); font-size: .9rem; }
.sigcard__done { display: flex; align-items: center; gap: 6px; margin: 0 0 8px; color: var(--green); font-weight: 600; }
.sigcard__preview { display: block; max-width: 240px; max-height: 90px; margin: 0 0 12px; border: 1px solid var(--line); border-radius: var(--r-sm); background: #fff; }

.sigpad { display: grid; gap: 12px; }
.sigpad__confirm { display: flex; gap: 10px; align-items: flex-start; font-size: .95rem; cursor: pointer; }
.sigpad__confirm input { width: 22px; height: 22px; margin-top: 3px; flex: 0 0 auto; accent-color: var(--brand); }
.sigpad__box {
    position: relative; height: 190px; border-radius: var(--r); background: #fff;
    border: 2px dashed color-mix(in srgb, var(--brand) 40%, var(--line));
}
.sigpad__canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; border-radius: inherit; z-index: 1; }
.sigpad__base {
    position: absolute; left: 16px; right: 16px; bottom: 40px; border-top: 1px solid var(--line);
    padding-top: 4px; color: var(--ink-2); font-size: .8rem; text-align: center; pointer-events: none;
}
.sigpad.is-signing .sigpad__box { border-style: solid; }
.sigpad__error { margin: 0; color: var(--maroon); font-weight: 600; font-size: .9rem; }
.sigpad__actions { display: grid; grid-template-columns: 1fr 2fr; gap: 10px; }
.sigpad__actions .button[disabled] { opacity: .6; cursor: progress; }

/* ── กรอบในฟอร์ม = ปุ่มเปิดแผ่นเซ็นเต็มจอ + ตัวอย่างลายเซ็น (8 พ.ย. 69) ── */
.sigpad__box.is-tap { cursor: pointer; }
.sigpad__box.is-tap .sigpad__canvas { cursor: pointer; touch-action: auto; pointer-events: none; }
.sigpad__box.is-tap:focus-visible { box-shadow: var(--focus); outline: none; }
.sigpad__tap {
    position: absolute; inset: 0; display: grid; place-content: center; gap: 4px; text-align: center;
    color: var(--brand); font-weight: 700; pointer-events: none;
}
.sigpad__tap small { font-weight: 500; color: var(--ink-2); }
.sigpad.is-signed .sigpad__tap { display: none; }
.sigpad.is-signed .sigpad__box { border-style: solid; }
.sigpad__lead {
    position: absolute; left: 14px; top: 10px; z-index: 2; pointer-events: none;
    font-family: "Chakra Petch", sans-serif; font-weight: 700; color: #1b3a8a;
}

/* ── แผ่นเซ็นเต็มจอ ── */
html.sigfs-open, html.sigfs-open body { overflow: hidden; }
.sigfs {
    position: fixed; inset: 0; z-index: 1000; display: grid; grid-template-rows: auto minmax(0, 1fr) auto auto;
    gap: 8px; padding: max(10px, env(safe-area-inset-top)) max(12px, env(safe-area-inset-right))
        max(10px, env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    background: var(--bg, #f5f7fb); color: var(--ink);
}
.sigfs[hidden] { display: none; }
.sigfs:focus { outline: none; }
.sigfs__head { display: grid; gap: 2px; }
.sigfs__title { margin: 0; font-size: 1.15rem; color: var(--brand); }
.sigfs__hint { margin: 0; font-size: .85rem; color: var(--ink-2); }
.sigfs__area {
    position: relative; min-height: 0; border-radius: var(--r); background: #fff;
    border: 2px solid color-mix(in srgb, var(--brand) 45%, var(--line));
}
.sigfs__canvas { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; cursor: crosshair; z-index: 1; }
.sigfs__lead {
    position: absolute; left: 4%; top: 8%; pointer-events: none;
    font-family: "Chakra Petch", sans-serif; font-weight: 700; font-size: clamp(1.3rem, 4.5vmin, 2.4rem); color: #1b3a8a;
}
.sigfs__base {
    position: absolute; left: 6%; right: 6%; bottom: 24%; border-top: 2px solid var(--line);
    padding-top: 4px; color: var(--ink-2); font-size: .8rem; text-align: center; pointer-events: none;
}
.sigfs__error { margin: 0; color: var(--maroon); font-weight: 600; }
.sigfs__actions { display: grid; grid-template-columns: 1fr 1fr 2fr; gap: 10px; }
.sigfs__actions .button { min-height: 48px; }

.signnext { display: grid; gap: 10px; margin: 8px 0 20px; }
.signnext__done { display: flex; align-items: center; gap: 8px; justify-content: center; color: var(--green); font-weight: 600; margin: 0; }

/* ── การ์ดหน้าหลัก ── */
.signcard {
    display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center;
    padding: 16px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none;
}
.signcard:focus-visible { outline: none; box-shadow: var(--focus); }
.signcard__icon { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--maroon-soft); color: var(--maroon); }
.signcard.is-done .signcard__icon { background: var(--green-soft); color: var(--green); }
.signcard__text { display: grid; gap: 2px; min-width: 0; }
.signcard__title { font-weight: 600; }
.signcard__sub { color: var(--ink-2); font-size: .88rem; }
.signcard__bar { grid-column: 1 / -1; display: block; height: 6px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.signcard__bar span { display: block; height: 100%; background: var(--green); border-radius: inherit; }

/* ── ผูก LINE หลังล็อกอิน (หน้าหลัก · LineLinkCard) ── */
.linecard__icon { background: color-mix(in srgb, var(--line-green) 14%, var(--surface)); color: var(--line-green-ink); }
.linenote {
    display: flex; gap: 8px; align-items: flex-start; margin: 0; padding: 10px 14px; border-radius: var(--r-sm);
    font-size: .92rem; color: var(--ink);
}
.linenote .icon { margin-top: 2px; flex: none; }
.linenote.is-ok { background: var(--green-soft); border: 1px solid color-mix(in srgb, var(--green) 30%, transparent); }
.linenote.is-ok .icon { color: var(--green); }
.linenote.is-error { background: var(--maroon-soft); border: 1px solid color-mix(in srgb, var(--maroon) 35%, transparent); }
.linenote.is-error .icon { color: var(--maroon); }
.linedone {
    display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; justify-content: space-between;
    padding: 10px 14px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line-soft); font-size: .92rem;
}
.linedone__text { display: grid; gap: 2px; min-width: 0; }
.linedone__title { display: inline-flex; gap: 6px; align-items: center; color: var(--line-green-ink); font-weight: 600; }
.linedone__when { color: var(--ink-2); font-size: .85rem; }
.linedone__actions { display: inline-flex; gap: 14px; align-items: center; }
.linedone__more { color: var(--line-green-ink); font-weight: 600; }
.linkconfirm { display: grid; gap: 10px; margin-top: 8px; }
.linkconfirm[hidden] { display: none; }
.linkconfirm__name { font-weight: 700; overflow-wrap: anywhere; }
.linedone__undo {
    border: 0; background: none; padding: 4px 0; font: inherit; color: var(--ink-2); text-decoration: underline; cursor: pointer;
}
.linedone__undo:hover { color: var(--maroon); }
.linedone__undo:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 4px; }
/* แท็บ "LINE" (/line · 8 พ.ย. 69) */
.linepage { display: grid; gap: 16px; max-width: 640px; }
.linesteps {
    margin: 0; padding: 16px 16px 16px 36px; display: grid; gap: 8px;
    background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg);
    color: var(--ink-2); font-size: .92rem;
}
.linesteps strong { color: var(--ink); font-weight: 600; }

/* แท็บ LINE: ทำไมควรผูก */
.linewhy {
    display: grid; gap: 12px; padding: 18px 16px;
    background: var(--surface); border: 1px solid var(--line-soft); border-radius: var(--r-lg); box-shadow: var(--shadow-sm);
}
.linewhy__title { font-size: 1.1rem; margin: 0; }
.linewhy__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.linewhy__list li { display: grid; grid-template-columns: auto 1fr; gap: 12px; align-items: start; color: var(--ink-2); font-size: .94rem; line-height: 1.55; }
.linewhy__list strong { color: var(--ink); font-weight: 600; display: block; }
.linewhy__icon {
    display: grid; place-items: center; width: 36px; height: 36px; border-radius: 12px;
    background: color-mix(in srgb, var(--line-green) 14%, var(--surface)); color: var(--line-green-ink);
}
.linewhy__oa {
    display: grid; gap: 10px; justify-items: start; margin-top: 4px; padding-top: 14px;
    border-top: 1px solid var(--line-soft); color: var(--ink-2); font-size: .92rem;
}
.linewhy__oa p { margin: 0; }
.linewhy__oa strong { color: var(--ink); font-weight: 600; }

/* แท็บ LINE: การ์ดวิดีโอแนะนำ (YouTube Shorts · เปิดแท็บใหม่) */
.lineguide {
    display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center;
    padding: 12px 16px 12px 12px; border-radius: var(--r-lg); background: var(--surface); border: 1px solid var(--line-soft);
    box-shadow: var(--shadow-sm); color: var(--ink); text-decoration: none;
}
.lineguide:hover { border-color: color-mix(in srgb, var(--line-green) 40%, var(--line-soft)); }
.lineguide:focus-visible { outline: none; box-shadow: var(--focus); }
.lineguide__thumb { position: relative; display: block; width: 72px; height: 128px; border-radius: 12px; overflow: hidden; background: var(--surface-2); }
.lineguide__thumb img { display: block; width: 100%; height: 100%; object-fit: cover; }
.lineguide__play {
    position: absolute; left: 50%; top: 50%; width: 40px; height: 40px; margin: -20px 0 0 -20px; border-radius: 50%;
    background: rgb(23 36 64 / 78%);
}
.lineguide__play::after {
    content: ""; position: absolute; left: 15px; top: 11px;
    border-style: solid; border-width: 9px 0 9px 15px; border-color: transparent transparent transparent #fff;
}
.lineguide__text { display: grid; gap: 4px; min-width: 0; }
.lineguide__title { font-weight: 600; }
.lineguide__sub { color: var(--ink-2); font-size: .88rem; }

/* ข้อมูลการสมัคร × ลงนาม (9 พ.ย. 69): เตือนว่าลงนามแล้วแก้เองไม่ได้ · มีคำขอรอตรวจ */
.signprofile { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 14px; padding: 12px 14px; border-radius: var(--r); background: var(--brand-soft); border: 1px solid var(--line); color: var(--ink); }
.signprofile .icon { flex: 0 0 auto; margin-top: 3px; }
.signprofile a { font-weight: 600; color: inherit; text-decoration: underline; white-space: nowrap; }
.signprofile--warn { background: var(--maroon-soft); border-color: transparent; color: var(--maroon); }
.signmsg__link { display: block; margin-top: 4px; color: inherit; text-decoration: underline; }
