:root {
    --primary-red: #d90000;
    --light-red: #cc0000;
    --bg-light: #f7f7f7;
    --border-grey: #ccc;
    --text-dark: #333;
    --text-light: #fff;
    --section-bg-red: #fcebeb; /* สีพื้นหลังอ่อนสำหรับกรอบแดง */
}

/* Base Styles */
body {
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--bg-light);
    color: var(--text-dark);
}
.vnc-logo {
    display: block;
    margin: 20px auto;
    max-width: 200px;
    height: auto;
}
.page-container {
    max-width: 1300px; 
    margin: 20px auto;
    background-color: var(--text-light);
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.page-title {
    color: var(--primary-red);
    font-size: 1.5em;
    border-bottom: 2px solid var(--primary-red);
    padding: 20px;
    margin: 0;
}

/* Form Layout (CSS Grid 3 คอลัมน์) */
.form-layout {
    display: grid;
    grid-template-columns: 180px 1fr 350px; 
    min-height: 800px;
}

/* --- คอลัมน์ 1: Sidebar Menu --- */
.sidebar-menu {
    background-color: var(--primary-red);
    color: var(--text-light);
    padding-top: 50px; 
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li button {
    width: 100%;
    padding: 15px 10px;
    border: none;
    background: none;
    color: var(--text-light);
    text-align: left;
    cursor: pointer;
    font-size: 1em;
    transition: background-color 0.3s;
}

.sidebar-menu li.active button {
    background-color: var(--light-red); 
    font-weight: bold;
    border-left: 5px solid var(--text-light);
}

/* --- คอลัมน์ 2: Form Content (ส่วนที่ HTMX สลับ) --- */
.form-content {
    padding: 30px;
    background-color: var(--text-light);
}

.form-header {
    border-bottom: 1px solid var(--border-grey);
    padding-bottom: 15px;
    margin-bottom: 20px;
}

.form-header h2 {
    color: var(--primary-red);
    font-size: 1.2em;
    margin: 0;
}

.step-title {
    display: block;
    color: var(--primary-red);
    font-size: 1.5em;
    font-weight: bold;
    margin-top: 5px;
}

label {
    display: block;
    font-weight: bold;
    margin-top: 15px;
    font-size: 0.9em;
}

input[type="text"], 
input[type="tel"],
input[type="url"],
select {
    width: 100%;
    padding: 8px 10px;
    margin-top: 5px;
    border: 1px solid var(--border-grey);
    border-radius: 4px;
    box-sizing: border-box; 
}

/* 2-Column Layout */
.info-section {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}
.info-col {
    flex: 1;
}

/* Required Fields Group (กรอบแดง) */
.required-fields-group {
    background-color: var(--section-bg-red); 
    border: 1px solid var(--primary-red); 
    border-radius: 5px;
    padding: 20px;
    margin-bottom: 30px;
}
.required-fields-group input {
    border: 1px solid var(--primary-red);
}
.form-row {
    display: flex;
    gap: 15px;
}
.input-group {
    flex: 1; 
}
.input-group.full-width {
    flex: 0 0 100%;
    margin-top: 10px;
}

/* Document/Photo Upload Sections */
.document-upload-section,
.photo-upload-grid {
    display: flex;
    justify-content: space-around;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}
.document-box,
.photo-box {
    flex: 1;
    min-width: 150px;
    height: 120px;
    border: 2px dashed var(--border-grey);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    border-radius: 5px;
    text-align: center;
    font-size: 0.9em;
    cursor: pointer;
    padding: 10px;
    box-sizing: border-box;
}

/* Form Actions (ปุ่ม) */
.form-actions {
    display: flex;
    justify-content: flex-end; 
    gap: 10px;
    margin-top: 20px;
}
.form-actions button {
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
    min-width: 120px;
}
.btn-secondary {
    background-color: var(--text-light);
    color: var(--primary-red);
    border: 1px solid var(--primary-red);
}
.btn-primary {
    background-color: var(--primary-red);
    color: var(--text-light);
    border: none;
}

/* --- คอลัมน์ 3: Rules Sidebar --- */
.rules-sidebar {
    background-color: var(--bg-light); 
    border-left: 1px solid var(--border-grey);
    padding: 30px 20px;
    font-size: 0.9em;
}

.rules-sidebar ol {
    list-style-type: none; 
    counter-reset: rule-counter; 
    padding-left: 0;
}

.rules-sidebar li {
    counter-increment: rule-counter; 
    margin-bottom: 15px;
    line-height: 1.4;
}

.rules-sidebar li::before {
    content: "1." counter(rule-counter) ". "; 
    color: var(--primary-red);
    font-weight: bold;
    margin-right: 5px;
}