/* ============================= */


/* signup-profile.css (Phase 3.7) */


/* สไตล์เฉพาะส่วนประวัติผู้เข้าอบรมในหน้า signup.html — โหลดต่อท้าย style.css */


/* ใช้ prefix .sp- ทุก class และอ้างอิงตัวแปรสีเดิมของ style.css จึงไม่กระทบหน้าอื่น */


/* Mobile-first: 360 / 390 / 640 / 768 / 960 / 1280 */


/* ============================= */


/* ---------- หัวข้อแต่ละส่วน ---------- */

.sp-heading {
    margin: 28px 0 0 0;
    padding-top: 22px;
    font-size: 17px;
    line-height: 1.4;
    color: var(--color-ink);
    border-top: 1px solid var(--color-line);
}


/* หัวข้อแรก (ข้อมูลบัญชี) อยู่ใต้ Header อยู่แล้ว ไม่ต้องมีเส้นคั่น */

.auth-form>.sp-heading:first-child {
    margin-top: 12px;
    padding-top: 0;
    border-top: 0;
}

.sp-section {
    min-width: 0;
}


/* ---------- ช่องกรอกที่ไม่มีไอคอนนำหน้า ---------- */

.auth-form .sp-input {
    padding-left: 14px;
}

.auth-form .sp-input[aria-invalid="true"] {
    border-color: var(--color-error);
    background-color: var(--color-error-bg);
}

.auth-form .sp-input[aria-invalid="true"]:focus {
    box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.16);
}

.sp-textarea {
    display: block;
    min-height: 96px;
    line-height: 1.55;
    resize: vertical;
}

.sp-select {
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235d6b69' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
    text-overflow: ellipsis;
}


/* ช่องวันที่: ให้สูงเท่าช่องอื่นทุก Browser (Safari iOS มักเตี้ยกว่า) */

.sp-input[type="date"] {
    min-height: 50px;
    appearance: none;
    -webkit-appearance: none;
}


/* ---------- ข้อความประกอบ ---------- */

.sp-optional {
    font-weight: 400;
    color: var(--color-muted);
}


/* หัวข้อ/ป้ายกำกับยาว ๆ ในจอแคบ (360px) ต้องขึ้นบรรทัดใหม่ ไม่ล้นการ์ด */

.auth-form .auth-label,
.sp-heading {
    overflow-wrap: anywhere;
}


/* ---------- Responsive ---------- */

@media (min-width: 640px) {
    .sp-heading {
        margin-top: 32px;
        padding-top: 26px;
        font-size: 18px;
    }
    .sp-textarea {
        min-height: 104px;
    }
}

@media (min-width: 960px) {
    /* ฟอร์มยาวขึ้น: ขยายการ์ดเล็กน้อยให้ช่องคู่ไม่แคบเกินไป */
    .auth-shell-signup .auth-card-wide {
        max-width: 620px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .auth-form .sp-input {
        transition: none;
    }
}


/* ---------- Signup: เลื่อนเฉพาะแผงฟอร์มด้านขวา (Desktop) ---------- */

@media (min-width: 960px) {
    /* ล็อก viewport เฉพาะหน้า Signup เพื่อไม่ให้ทั้งหน้าเลื่อน */
    .auth-body-signup {
        height: 100vh;
        height: 100dvh;
        overflow: hidden;
    }
    .auth-body-signup .auth-shell-signup {
        height: 100%;
        min-height: 0;
        grid-template-rows: minmax(0, 1fr);
        overflow: hidden;
    }
    /* แผงซ้ายอยู่กับที่และไม่สร้าง scrollbar */
    .auth-body-signup .auth-aside {
        min-height: 0;
        height: 100%;
    }
    /* ให้เลื่อนเฉพาะคอลัมน์ฟอร์มด้านขวา */
    .auth-body-signup .auth-main {
        min-height: 0;
        height: 100%;
        align-items: flex-start;
        overflow-x: hidden;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        scrollbar-gutter: stable;
        padding-top: 48px;
        padding-bottom: 48px;
    }
    .auth-body-signup .auth-card-wide {
        flex: 0 0 auto;
        margin: 0 auto;
    }
}

/* ---------- ช่องยินยอมข้อมูลส่วนบุคคล (อยู่เหนือปุ่มสมัคร) ---------- */

.sp-consent {
    margin-top: 24px;
}

.sp-consent .sp-consent-row {
    margin-top: 0;
    line-height: 1.55;
    overflow-wrap: anywhere;
}

.sp-consent .sp-consent-row input[aria-invalid="true"] {
    outline: 2px solid var(--color-error);
    outline-offset: 2px;
}