* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Sarabun', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #1e3c72 0%, #2a5298 50%, #4a6fa5 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    background: white;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
    overflow: hidden;
    border: 1px solid #e0e9f0;
}

.header {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 50%, #3182ce 100%);
    color: white;
    padding: 30px;
    text-align: center;
    border-bottom: 3px solid #1a202c;
}

.header img {
    border: 3px solid white;
    border-radius: 50%;
    margin-bottom: 15px;
}

.header h1 {
    font-size: 2.2em;
    margin-bottom: 10px;
    font-weight: 600;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1em;
    opacity: 0.95;
    font-weight: 400;
    line-height: 1.4;
}

.form-container {
    padding: 40px;
    background: #fafbfc;
}

.form-group {
    margin-bottom: 25px;
    background: white;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #1a202c;
    font-size: 1em;
}

.required {
    color: #e53e3e;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #cbd5e0;
    border-radius: 6px;
    font-size: 16px;
    transition: all 0.3s ease;
    font-family: inherit;
    background: white;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.multiple-file-upload {
    margin-top: 10px;
}

.file-upload-zone {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #fafafa;
}

.file-upload-zone:hover {
    border-color: #007bff;
    background-color: #f0f8ff;
}

.file-upload-zone.dragover {
    border-color: #007bff;
    background-color: #e6f3ff;
}

.file-upload-zone.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.upload-placeholder p {
    margin: 0 0 10px 0;
    font-size: 16px;
    color: #666;
}

.upload-placeholder small {
    color: #999;
    line-height: 1.4;
}

.file-preview-container {
    margin-top: 20px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.file-preview-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px;
    background: white;
    position: relative;
}

.file-preview-image {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 8px;
}

.file-preview-info {
    font-size: 12px;
    color: #666;
}

.file-preview-name {
    font-weight: bold;
    margin-bottom: 4px;
    word-break: break-word;
}

.file-remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(220, 53, 69, 0.8);
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    line-height: 1;
}

.file-remove-btn:hover {
    background: rgba(220, 53, 69, 1);
}

.file-count-info {
    margin-top: 10px;
    font-size: 14px;
    color: #666;
    text-align: center;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin: 30px 0;
    padding: 25px;
    background: white;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.checkbox-group input[type="checkbox"] {
    width: 22px !important;
    height: 22px !important;
    min-width: 22px;
    min-height: 22px;
    margin: 0;
    transform: none;
    cursor: pointer;
    accent-color: #3182ce;
}

.checkbox-group label {
    margin: 0;
    font-weight: 500;
    line-height: 1.6;
    color: #2d3748;
    cursor: pointer;
    font-size: 0.95em;
}

.submit-btn {
    background: linear-gradient(135deg, #1a365d 0%, #2c5282 50%, #3182ce 100%);
    color: white;
    padding: 16px 40px;
    border: none;
    border-radius: 8px;
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    text-transform: none;
    letter-spacing: 0.5px;
    border: 2px solid transparent;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #2c5282 0%, #3182ce 50%, #4299e1 100%);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(49, 130, 206, 0.3);
}

.submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    background: #a0aec0;
}

.alert {
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid;
    display: none;
    font-weight: 500;
}

.alert-success {
    background: #f0fff4;
    color: #22543d;
    border-color: #38a169;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border-color: #e53e3e;
}

.error-message {
    color: #e53e3e;
    font-size: 0.9em;
    margin-top: 5px;
    display: none;
    font-weight: 500;
}

.file-info {
    margin-top: 10px;
    padding: 15px;
    background: #f0fff4;
    border-radius: 6px;
    color: #22543d;
    display: none;
    border: 1px solid #9ae6b4;
}

.help-text {
    font-size: 0.85em;
    color: #718096;
    margin-top: 5px;
    font-weight: 400;
}

.loading {
    display: none;
    text-align: center;
    color: #3182ce;
    font-weight: 500;
}

.locked-notice {
    background: #fefcbf; 
    color: #744210; 
    padding: 20px; 
    border-radius: 8px;
    margin: 20px 0; 
    border: 1px solid #f6e05e; 
    display: none;
    font-weight: 500;
}

.form-group input:disabled, 
.form-group textarea:disabled {
    background-color: #edf2f7;
    color: #a0aec0;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.file-upload.disabled .file-upload-label {
    background-color: #edf2f7;
    color: #a0aec0;
    cursor: not-allowed;
    border-color: #e2e8f0;
}

.file-upload.disabled input[type="file"] {
    cursor: not-allowed;
    pointer-events: none;
}

@media (max-width: 768px) {
    .container {
        margin: 10px;
        border-radius: 8px;
    }
    
    .header {
        padding: 20px 15px;
    }
    
    .header h1 {
        font-size: 1.8em;
    }
    
    .header p {
        font-size: 0.9em;
    }
    
    .form-container {
        padding: 20px 15px;
    }

    .form-group {
        padding: 15px;
        margin-bottom: 20px;
    }

    .checkbox-group {
        padding: 20px 15px;
        gap: 15px;
        flex-direction: column;
        align-items: flex-start;
    }

    .checkbox-group input[type="checkbox"] {
        width: 24px !important;
        height: 24px !important;
        min-width: 24px;
        min-height: 24px;
        margin-top: 2px;
        flex-shrink: 0;
    }

    /* สำหรับมือถือ ให้ checkbox และ label อยู่ในแนวนอน */
    @media (max-width: 480px) {
        .checkbox-group {
            flex-direction: row;
            align-items: flex-start;
            gap: 15px;
        }

        .checkbox-group input[type="checkbox"] {
            width: 26px !important;
            height: 26px !important;
            min-width: 26px;
            min-height: 26px;
            margin-top: 0;
        }

        .checkbox-group label {
            font-size: 0.9em;
            line-height: 1.5;
        }
    }
}

.notice-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  pointer-events: auto;
  visibility: visible;
}

.notice-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 12, 23, 0.6);
  backdrop-filter: blur(2px);
}

.notice-card {
  position: relative;
  width: 92%;
  max-width: 720px;
  background: linear-gradient(180deg, #ffffff, #fbfdff);
  border-radius: 12px;
  padding: 22px;
  box-shadow: 0 18px 40px rgba(10,23,40,0.25);
  z-index: 10000;
  color: #1a202c;
  text-align: left;
  font-family: inherit;
}

.notice-card h2 {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: #153243;
}

.notice-message {
  font-size: 1rem;
  line-height: 1.6;
  color: #2d3748;
  margin-bottom: 18px;
}

/* Actions layout */
.notice-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.notice-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  color: #1a202c;
}

.notice-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #2c5282;
  cursor: pointer;
}

/* Buttons */
.notice-btns { margin-left: auto; }
.notice-btn {
  padding: 10px 18px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-weight: 700;
  background: linear-gradient(135deg,#2c5282,#3182ce);
  color: white;
  transition: all .15s ease;
}
.notice-btn[disabled] {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.2);
}

/* Close X */
.notice-close {
  position: absolute;
  top: 10px;
  right: 12px;
  background: transparent;
  border: none;
  font-size: 20px;
  line-height: 1;
  color: #4a5568;
  cursor: pointer;
}

/* Mobile */
@media (max-width: 480px) {
  .notice-card { padding: 16px; }
  .notice-message { font-size: 0.95rem; }
  .notice-btn { width: 100%; }
  .notice-actions { flex-direction: column; align-items: stretch; }
}
