﻿:root {
    --hu-navy: #003366;
    --hu-navy2: #004080;
    --hu-orange: #E85D04;
    --hu-gold: #F5A623;
    --hu-light: #F0F4F8;
    --hu-border: #D1DCE8;
    --hu-green: #276749;
    --radius-card: 14px;
    --shadow-card: 0 2px 12px rgba(0,0,0,0.08), 0 0 0 1px rgba(0,0,0,0.04);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: 'Sarabun', sans-serif;
    background: linear-gradient(160deg, #dde8f5 0%, #e8eef8 60%, #f0f4f8 100%);
    background-attachment: fixed;
    margin: 0;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* ── HEADER ── */
.site-header {
    background: linear-gradient(90deg, #002255 0%, #003d80 100%);
    padding: 0 16px;
    height: 60px;
    display: flex;
    align-items: center;
    gap: 14px;
    position: sticky;
    top: 0;
    z-index: 200;
    box-shadow: 0 2px 16px rgba(0,0,0,0.25);
}

.logo-wrap {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: white;
    padding: 3px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px rgba(255,255,255,0.3);
    overflow: hidden;
}

    .logo-wrap img {
        width: 100%;
        height: 100%;
        object-fit: contain;
        border-radius: 50%;
    }

.title-group {
    color: white;
    flex: 1;
    min-width: 0;
}

    .title-group h1 {
        font-size: clamp(13px, 3.5vw, 17px);
        font-weight: 800;
        margin: 0;
        line-height: 1.2;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .title-group p {
        font-size: clamp(10px, 2.5vw, 12px);
        opacity: 0.65;
        margin: 1px 0 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

/* ── PROGRESS BAR ── */
.progress-wrap {
    background: white;
    border-bottom: 1px solid var(--hu-border);
    padding: 0 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

    .progress-wrap::-webkit-scrollbar {
        display: none;
    }

.progress-inner {
    display: flex;
    align-items: stretch;
    max-width: 860px;
    margin: 0 auto;
    min-width: 420px;
}

.prog-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 4px 8px;
    flex: 1;
    border-bottom: 3px solid transparent;
    transition: all 0.25s;
    min-width: 56px;
    cursor: default;
}

    .prog-item.active {
        border-bottom-color: var(--hu-orange);
    }

    .prog-item.done {
        border-bottom-color: var(--hu-navy);
    }

.prog-num {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: #CBD5E0;
    color: #718096;
    font-weight: 700;
    font-size: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 4px;
    transition: all 0.25s;
    flex-shrink: 0;
}

.prog-item.active .prog-num {
    background: var(--hu-orange);
    color: white;
    box-shadow: 0 2px 6px rgba(232,93,4,0.4);
}

.prog-item.done .prog-num {
    background: var(--hu-navy);
    color: white;
}

.prog-label {
    font-size: clamp(8px, 1.8vw, 10px);
    color: #718096;
    text-align: center;
    font-weight: 500;
    line-height: 1.2;
}

.prog-item.active .prog-label {
    color: var(--hu-orange);
    font-weight: 700;
}

.prog-item.done .prog-label {
    color: var(--hu-navy);
    font-weight: 600;
}

.prog-sep {
    width: 1px;
    background: #E2E8F0;
    flex-shrink: 0;
    margin: 8px 0;
}

/* ── MAIN WRAPPER ── */
.main-wrap {
    max-width: 860px;
    margin: 20px auto 0;
    padding: 0 12px 100px;
}

/* ── CARD ── */
.card {
    background: white;
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.card-header {
    background: linear-gradient(90deg, #002255 0%, #004080 100%);
    color: white;
    padding: 16px 20px;
    position: relative;
    overflow: hidden;
}

    .card-header::after {
        content: '';
        position: absolute;
        right: -20px;
        top: -20px;
        width: 100px;
        height: 100px;
        background: rgba(255,255,255,0.05);
        border-radius: 50%;
    }

    .card-header h2 {
        font-size: clamp(14px, 3.5vw, 17px);
        font-weight: 800;
        margin: 0;
        line-height: 1.3;
    }

    .card-header p {
        font-size: 12px;
        opacity: 0.65;
        margin: 4px 0 0;
    }

.card-body {
    padding: clamp(14px, 4vw, 24px);
}

/* ── SECTION TITLE ── */
.section-title {
    font-size: 13px;
    font-weight: 800;
    color: var(--hu-navy);
    padding: 0 0 8px 12px;
    border-bottom: 2px solid #E2E8F0;
    margin-bottom: 16px;
    position: relative;
    letter-spacing: 0.2px;
}

    .section-title::before {
        content: '';
        position: absolute;
        left: 0;
        top: 1px;
        width: 4px;
        height: 18px;
        background: linear-gradient(180deg, var(--hu-orange), #ff8a3d);
        border-radius: 2px;
    }

/* ── FORM ELEMENTS ── */
label {
    font-size: 13px;
    font-weight: 600;
    color: #2D3748;
    display: block;
    margin-bottom: 5px;
}

    label .req {
        color: var(--hu-orange);
    }

input[type="text"], input[type="tel"], input[type="email"], input[type="date"],
select, textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid #CBD5E0;
    border-radius: 9px;
    font-size: 14px;
    font-family: 'Sarabun', sans-serif;
    background: #FAFBFC;
    transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
    color: #1A202C;
    -webkit-appearance: none;
}

    input:focus, select:focus, textarea:focus {
        outline: none;
        border-color: var(--hu-navy);
        box-shadow: 0 0 0 3px rgba(0,51,102,0.12);
        background: white;
    }

select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 36px;
}

.form-group {
    margin-bottom: 14px;
}

.form-row {
    display: grid;
    gap: 12px;
}

    .form-row.col2 {
        grid-template-columns: 1fr 1fr;
    }

    .form-row.col3 {
        grid-template-columns: 1fr 1fr 1fr;
    }

/* ── RADIO / CHECKBOX ── */
.radio-group, .checkbox-group {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.radio-btn {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 9px 16px;
    border: 1.5px solid #CBD5E0;
    border-radius: 9px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #4A5568;
    transition: all 0.15s;
    background: white;
    user-select: none;
}

    .radio-btn input {
        display: none;
    }

    .radio-btn.selected {
        background: #EBF4FF;
        border-color: var(--hu-navy);
        color: var(--hu-navy);
        font-weight: 700;
        box-shadow: 0 0 0 2px rgba(0,51,102,0.08);
    }

.radio-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px;
    border: 1.5px solid #CBD5E0;
    border-radius: 10px;
    background: #fff;
    text-decoration: none;
    color: #4A5568;
    cursor: pointer;
    transition: .2s;
}

.radio-circle {
    width: 18px;
    height: 18px;
    border: 2px solid #C8CDD8;
    border-radius: 50%;
}

.radio-btn.selected {
    background: #EBF8FF;
    border-color: #2563EB;
    color: #2563EB;
}

    .radio-btn.selected .radio-circle {
        background: #2563EB;
        border-color: #2563EB;
        box-shadow: inset 0 0 0 4px #fff;
    }

/* ── TAB ── */
.tab-row {
    display: flex;
    border: 1.5px solid #CBD5E0;
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 11px 8px;
    font-size: 13px;
    font-weight: 700;
    text-align: center;
    cursor: pointer;
    background: #F7FAFC;
    color: #718096;
    border: none;
    font-family: 'Sarabun', sans-serif;
    transition: all 0.2s;
}

    .tab-btn.active {
        background: var(--hu-navy);
        color: white;
    }

/* ── CONSENT BOX ── */
.consent-box {
    border: 1.5px solid #CBD5E0;
    border-radius: 10px;
    max-height: 260px;
    overflow-y: auto;
    padding: 16px 18px;
    font-size: 12px;
    line-height: 1.9;
    color: #4A5568;
    background: #FAFBFC;
}

    .consent-box::-webkit-scrollbar {
        width: 5px;
    }

    .consent-box::-webkit-scrollbar-thumb {
        background: #CBD5E0;
        border-radius: 3px;
    }

    .consent-box h4 {
        font-size: 13px;
        font-weight: 700;
        color: var(--hu-navy);
        margin: 0 0 10px;
    }

/* ── INFO BOXES ── */
.info-box {
    background: #EBF4FF;
    border: 1.5px solid #90CDF4;
    border-radius: 9px;
    padding: 11px 15px;
    font-size: 12.5px;
    color: #2C5282;
    margin-bottom: 14px;
    line-height: 1.6;
}

    .info-box.warning {
        background: #FFFBEB;
        border-color: #F6D860;
        color: #7B5C00;
    }

    .info-box.success {
        background: #F0FFF4;
        border-color: #68D391;
        color: #1A4731;
    }

/* ── BUTTONS ── */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 22px;
    border-radius: 9px;
    font-size: 14px;
    font-weight: 700;
    font-family: 'Sarabun', sans-serif;
    cursor: pointer;
    border: none;
    transition: all 0.18s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
}

    .btn:active {
        transform: scale(0.97);
    }

.btn-primary {
    background: var(--hu-navy);
    color: white;
    box-shadow: 0 2px 8px rgba(0,51,102,0.25);
}

    .btn-primary:hover {
        background: #002a5c;
    }

.btn-orange {
    background: var(--hu-orange);
    color: white;
    box-shadow: 0 2px 8px rgba(232,93,4,0.3);
}

    .btn-orange:hover {
        background: #c94e03;
    }

.btn-outline {
    background: white;
    color: var(--hu-navy);
    border: 1.5px solid var(--hu-navy);
}

    .btn-outline:hover {
        background: #EBF4FF;
    }

.btn-success {
    background: var(--hu-green);
    color: white;
    box-shadow: 0 2px 8px rgba(39,103,73,0.3);
}

    .btn-success:hover {
        background: #1c4532;
    }

.btn-lg {
    padding: 13px 28px;
    font-size: 15px;
    border-radius: 10px;
}

/* ── ACTION BAR ── */
.action-bar {
    background: #FAFBFC;
    border-top: 1px solid var(--hu-border);
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    border-radius: 0 0 var(--radius-card) var(--radius-card);
}

/* ── TAGS ── */
.tag {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
}

.tag-opt {
    background: #E2E8F0;
    color: #4A5568;
}

.tag-req {
    background: #FED7D7;
    color: #C53030;
}

/* ── SUMMARY TABLE ── */
.summary-table {
    width: 100%;
    border-collapse: collapse;
}

    .summary-table tr {
        border-bottom: 1px solid #EDF2F7;
    }

        .summary-table tr:last-child {
            border-bottom: none;
        }

    .summary-table td {
        padding: 10px 12px;
        font-size: 13px;
        vertical-align: top;
    }

        .summary-table td:first-child {
            font-weight: 600;
            color: #718096;
            width: 38%;
        }

        .summary-table td:last-child {
            color: var(--hu-navy);
            font-weight: 700;
        }

/* ── AGREE ROW ── */
.agree-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 13px 15px;
    background: #F7FAFC;
    border: 1.5px solid #CBD5E0;
    border-radius: 9px;
    margin-top: 14px;
}

    .agree-row input[type="checkbox"] {
        width: 18px;
        height: 18px;
        margin-top: 1px;
        accent-color: var(--hu-navy);
        flex-shrink: 0;
        cursor: pointer;
    }

    .agree-row label {
        font-size: 13px;
        color: #2D3748;
        font-weight: 500;
        margin: 0;
        cursor: pointer;
        line-height: 1.5;
    }

/* ── SUCCESS PAGE ── */
.success-wrap {
    text-align: center;
    padding: 32px 20px;
}

.success-icon {
    width: 76px;
    height: 76px;
    background: linear-gradient(135deg, #C6F6D5, #9AE6B4);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 38px;
    margin: 0 auto 20px;
    box-shadow: 0 4px 16px rgba(39,103,73,0.2);
}

/* ── QR CARD ── */
.qr-card {
    display: inline-block;
    padding: 14px;
    border: 2px solid #E2E8F0;
    border-radius: 14px;
    background: white;
    box-shadow: 0 3px 12px rgba(0,0,0,0.08);
}

    .qr-card img {
        display: block;
    }

/* ── EXAM CARD ── */
.exam-card {
    background: linear-gradient(135deg, #EBF4FF, #E8F0FF);
    border: 1.5px solid #90CDF4;
    border-radius: 10px;
    padding: 16px 18px;
    margin-top: 14px;
}

/* ── FILE UPLOAD ── */
.file-area {
    border: 2px dashed #CBD5E0;
    border-radius: 10px;
    padding: 18px;
    text-align: center;
    background: #FAFBFC;
    transition: all 0.15s;
    cursor: pointer;
}

    .file-area:hover {
        border-color: var(--hu-navy);
        background: #F0F4FA;
    }

    .file-area input[type="file"] {
        display: none;
    }

.file-icon {
    font-size: 26px;
    margin-bottom: 5px;
}

.file-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--hu-navy);
    display: block;
}

.file-sub {
    font-size: 11px;
    color: #718096;
}

/* ── STEP PAGES ── */
.step-page {
    display: none;
}

    .step-page.active {
        display: block;
    }

/* ── SCROLL CONSENT ── */
.scroll-required-overlay {
    position: relative;
}

    .scroll-required-overlay::after {
        content: '↓ เลื่อนอ่านให้ครบเพื่อยืนยัน';
        position: absolute;
        bottom: 0;
        left: 0;
        right: 0;
        background: linear-gradient(transparent, rgba(240,244,248,0.96));
        text-align: center;
        padding: 28px 0 10px;
        font-size: 11px;
        color: #718096;
        pointer-events: none;
    }

    .scroll-required-overlay.scrolled::after {
        display: none;
    }

/* ── REASON GRID ── */
.reason-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.reason-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 12px;
    border: 1.5px solid #CBD5E0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 12px;
    color: #4A5568;
    background: white;
    transition: all 0.15s;
}

    .reason-item input {
        accent-color: var(--hu-navy);
        cursor: pointer;
        flex-shrink: 0;
    }

    .reason-item:has(input:checked) {
        border-color: var(--hu-navy);
        background: #EBF4FF;
        color: var(--hu-navy);
        font-weight: 600;
    }

/* ── MISC ── */
.conditional {
    display: none;
}

    .conditional.show {
        display: block;
    }

.input-hint {
    font-size: 11px;
    color: #718096;
    margin-top: 4px;
}

.divider {
    border: none;
    border-top: 1px solid #E2E8F0;
    margin: 18px 0;
}

/* ══════════════════════════════
           RESPONSIVE — Mobile ≤ 480px
        ══════════════════════════════ */
@media (max-width: 480px) {
    .site-header {
        height: 54px;
        padding: 0 12px;
        gap: 10px;
    }

    .logo-wrap {
        width: 38px;
        height: 38px;
    }

    .form-row.col2, .form-row.col3 {
        grid-template-columns: 1fr;
    }

    .reason-grid {
        grid-template-columns: 1fr;
    }

    .card-body {
        padding: 14px 12px;
    }

    .action-bar {
        padding: 10px 14px;
    }

    .btn-lg {
        padding: 12px 18px;
        font-size: 14px;
    }

    .main-wrap {
        padding: 0 8px 80px;
        margin-top: 12px;
    }

    .summary-table td:first-child {
        width: 45%;
        font-size: 12px;
    }

    .summary-table td {
        padding: 8px 8px;
        font-size: 12px;
    }

    .radio-card-group {
        display: flex;
        gap: 20px;
        margin-top: 15px;
    }

        .radio-card-group input[type=radio] {
            display: none;
        }

    .radio-card {
        width: 180px;
        height: 120px;
        border: 2px solid #d9d9d9;
        border-radius: 14px;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        transition: .25s;
        font-size: 40px;
        background: #fff;
    }

        .radio-card span {
            font-size: 18px;
            margin-top: 10px;
            font-weight: 600;
        }

        .radio-card:hover {
            transform: translateY(-4px);
            box-shadow: 0 8px 20px rgba(0,0,0,.15);
            border-color: #173d69;
        }

    .radio-card-group input[type=radio]:checked + .radio-card {
        background: #173d69;
        color: #fff;
        border-color: #173d69;
    }


}

/* ══════════════════════════════
           RESPONSIVE — Tablet 481-768px
        ══════════════════════════════ */
@media (min-width: 481px) and (max-width: 768px) {
    .form-row.col3 {
        grid-template-columns: 1fr 1fr;
    }

    .main-wrap {
        padding: 0 14px 80px;
    }
}

/* ══════════════════════════════
           Touch device tap targets
        ══════════════════════════════ */
@media (hover: none) {
    .radio-btn, .reason-item, .btn {
        min-height: 44px;
    }

    input[type="text"], input[type="tel"], select {
        min-height: 44px;
        font-size: 16px;
    }
    /* 16px prevents iOS zoom */
}
