/* 
 * Application Form CSS for Innolab Enrolment Form
 * 多步骤表单样式
 */

/* 步骤进度条 */
.form-stepper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.form-stepper::before {
    content: '';
    position: absolute;
    top: 15px;
    left: 0;
    right: 0;
    height: 2px;
    background-color: var(--gray-20);
    z-index: 1;
}

/* 申请类型指示器 */
.form-type-indicator {
    position: absolute;
    top: -30px;
    right: 0;
    background-color: var(--primary-green);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    display: none; /* 隐藏用户身份标记 */
}

.form-type-indicator::after {
    content: '';
    position: absolute;
    bottom: -5px;
    right: 20px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 5px solid var(--primary-green);
}

.step-item {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
}

.step-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: white;
    border: 2px solid var(--gray-20);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 10px;
    font-weight: 600;
    color: var(--gray-60);
}

.step-title {
    font-size: 14px;
    color: var(--gray-60);
    margin-top: 5px;
}

/* 当前步骤 */
.step-active .step-circle {
    background-color: var(--primary-green);
    border-color: var(--primary-green);
    color: white;
}

.step-active .step-title {
    color: var(--primary-green);
    font-weight: 600;
}

/* 已完成步骤 */
.step-completed .step-circle {
    background-color: white;
    border-color: var(--primary-green);
    color: var(--primary-green);
}

.step-completed .step-title {
    color: var(--primary-green);
}

/* 申请表单布局 */
.application-form {
    max-width: 800px;
    margin: 0 auto;
}

.form-section {
    margin-bottom: 30px;
}

.form-section-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-20);
    color: var(--primary-green);
}

/* 表单行布局 */
.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: -10px;
}

.form-col-12 {
    width: 100%;
    padding: 10px;
}

.form-col-6 {
    width: 50%;
    padding: 10px;
}

.form-col-4 {
    width: 33.333%;
    padding: 10px;
}

.form-col-3 {
    width: 25%;
    padding: 10px;
}

/* 单选和复选框样式 */
.form-check {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.form-check-input {
    margin-right: 10px;
    width: 18px;
    height: 18px;
}

/* 垂直排列的复选框组 */
.form-check-group-vertical .custom-checkbox {
    display: block; /* 确保每个复选框单独成行 */
    margin-bottom: 10px; /* 复选框之间的间距 */
    width: 100%; /* 确保宽度足够 */
}

.form-check-group-vertical .checkbox-checkmark {
    position: relative;
    display: inline-block;
    height: 18px;
    width: 18px;
    background-color: white;
    border: 2px solid rgba(0, 0, 0, 0.2);
    border-radius: 4px;
    margin-right: 8px;
    transition: all 0.2s ease;
    min-width: 18px; /* 确保最小宽度 */
}

.form-check-group-vertical .custom-checkbox:hover .checkbox-checkmark {
    border-color: var(--primary-green, #2a9d8f);
}

.form-check-group-vertical .custom-checkbox input:checked ~ .checkbox-checkmark {
    background-color: var(--primary-green, #2a9d8f);
    border-color: var(--primary-green, #2a9d8f);
}

.form-check-group-vertical .checkbox-checkmark:after {
    content: "";
    position: absolute;
    display: none;
    left: 50%;
    top: 40%;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -40%) rotate(45deg);
}

.form-check-group-vertical .custom-checkbox input:checked ~ .checkbox-checkmark:after {
    display: block;
}

.form-control-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    line-height: 1.5;
    border-radius: 0.2rem;
}

/* 文件上传区域 */
.file-upload-area {
    border: 2px dashed var(--gray-40);
    border-radius: 4px;
    padding: 20px;
    text-align: center;
    margin-bottom: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.file-upload-area:hover {
    border-color: var(--primary-green);
    background-color: rgba(37, 146, 79, 0.05);
}

.file-upload-dragover {
    border-color: var(--primary-green);
    background-color: rgba(37, 146, 79, 0.1);
}

.file-upload-icon {
    font-size: 24px;
    margin-bottom: 10px;
}

.file-upload-text {
    color: var(--gray-60);
}

.file-list {
    margin-top: 10px;
}

.file-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border: 1px solid var(--gray-20);
    border-radius: 4px;
    margin-bottom: 5px;
    background-color: #f9f9f9;
}

.file-item-icon {
    font-size: 20px;
    margin-right: 10px;
}

.file-item-info {
    flex: 1;
}

.file-item-name {
    font-weight: 500;
    margin-bottom: 3px;
}

.file-item-size {
    font-size: 12px;
    color: var(--gray-60);
}

.file-item-status {
    margin: 0 10px;
    font-size: 13px;
}

.file-item-remove {
    cursor: pointer;
    font-size: 18px;
    color: var(--error-color);
    opacity: 0.7;
    transition: opacity 0.2s;
}

.file-item-remove:hover {
    opacity: 1;
}

/* 文件状态样式 */
.file-status-pending .file-item-status {
    color: var(--gray-60);
}

.file-status-uploading .file-item-status {
    color: var(--primary-color);
}

.file-status-uploaded .file-item-status {
    color: var(--success-color);
}

.file-status-error .file-item-status {
    color: var(--error-color);
}

/* 步骤导航 */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-20);
}

/* 条款和协议样式 */
.terms-container {
    position: relative;
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid var(--gray-20, #cccccc);
    border-radius: 8px;
    padding: 20px;
    padding-top: 50px;
    margin-bottom: 20px;
    background-color: var(--gray-5, #f9f9f9);
    font-size: 14px;
    line-height: 1.5;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .form-col-6, .form-col-4, .form-col-3 {
        width: 100%;
    }
    
    .form-stepper {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .form-stepper::before {
        display: none;
    }
    
    .step-item {
        display: flex;
        align-items: center;
        margin-bottom: 10px;
    }
    
    .step-circle {
        margin: 0 15px 0 0;
    }
} 

/* Submission Overlay Styles */
#submission-overlay {
  position: fixed; /* 固定定位，覆盖整个视口 */
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.65); /* 半透明黑色背景 */
  display: flex; /* 使用 flex 布局居中 */
  align-items: center;
  justify-content: center;
  z-index: 10000; /* 确保在最顶层 */
  cursor: wait; /* 显示等待光标 */
  opacity: 0; /* 初始透明 */
  transition: opacity 0.3s ease; /* 添加淡入淡出效果 */
}

#submission-overlay.visible {
  opacity: 1; /* 可见状态 */
}

#submission-overlay .modal-content {
  background-color: white;
  padding: 30px 40px;
  border-radius: 10px;
  text-align: center;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);
  max-width: 350px;
  transform: scale(0.95); /* 初始稍微缩小 */
  transition: transform 0.3s ease;
}

#submission-overlay.visible .modal-content {
  transform: scale(1); /* 可见时恢复正常大小 */
}

#submission-overlay h4 {
  margin-top: 0;
  margin-bottom: 15px;
  color: var(--primary-green, #2a9d8f);
  font-size: 1.1rem;
}

#submission-overlay p {
  margin-bottom: 0;
  color: var(--gray-60, #666666);
  font-size: 0.9rem;
}

/* Basic CSS Spinner */
#submission-overlay .spinner {
  width: 40px;
  height: 40px;
  border: 4px solid rgba(42, 157, 143, 0.2); /* 浅绿色边框 */
  border-top-color: var(--primary-green, #2a9d8f); /* 主题绿顶部 */
  border-radius: 50%;
  margin: 0 auto 20px auto;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* --- New Terms Modal Styles --- */

/* Full View Button Style Adjustments */
#view-terms-button {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 5;
  padding: 6px 12px;
  font-size: 0.85rem;
  border-color: var(--primary-green);
  color: var(--primary-green);
  border-radius: 6px;
  background-color: white;
  margin: 0;
}

#view-terms-button:hover {
  background-color: var(--primary-green);
  color: white;
}

#view-terms-button .btn-icon {
   margin-right: 5px;
}

/* Terms Modal Overlay */
#terms-modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7); /* Slightly darker background */
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999; /* Lower than submission overlay */
  opacity: 0;
  transition: opacity 0.3s ease;
}

#terms-modal-overlay.visible {
  opacity: 1;
}

/* Terms Modal Content Box */
.terms-modal-content {
  background-color: white;
  border-radius: 12px; 
  width: 95vw; /* 95% of viewport width */
  max-width: 95vw; /* Adjust max-width accordingly */
  height: 90vh; /* 90% of viewport height */
  max-height: 90vh; /* Adjust max-height accordingly */
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  overflow: hidden; /* Prevent content overflow */
  transform: scale(0.95);
  transition: transform 0.3s ease;
}

#terms-modal-overlay.visible .terms-modal-content {
  transform: scale(1);
}

/* Terms Modal Header */
.terms-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 25px;
  border-bottom: 1px solid var(--gray-20);
  flex-shrink: 0; /* Prevent header shrinking */
}

.terms-modal-header h3 {
  margin: 0;
  font-size: 1.2rem;
  color: var(--primary-green);
}

/* Terms Modal Close Button */
.close-terms-modal {
  background: none;
  border: none;
  font-size: 2rem;
  font-weight: 300;
  color: var(--gray-40);
  cursor: pointer;
  padding: 0 5px;
  line-height: 1;
  transition: color 0.2s ease;
}

.close-terms-modal:hover {
  color: var(--primary-black);
}

/* Terms Modal Body (Scrollable Content) */
.terms-modal-body {
  padding: 25px;
  overflow-y: auto; /* Enable vertical scrolling */
  flex-grow: 1; /* Allow body to fill remaining space */
  line-height: 1.6; /* Improve readability */
  color: var(--gray-80);
}

/* Style headings and lists inside the modal body like the original container */
.terms-modal-body h4 {
  color: var(--primary-green, #2a9d8f);
  margin-top: 1.2em;
  margin-bottom: 0.6em;
}

.terms-modal-body p {
  margin-bottom: 0.8em;
}

.terms-modal-body ul, 
.terms-modal-body ol {
  padding-left: 25px;
  margin-bottom: 0.8em;
}

.terms-modal-body li {
  margin-bottom: 0.4em;
}

/* --- New Student Declaration Section Styles --- */
.student-declaration-section {
  border: 1px solid var(--gray-20, #cccccc);
  border-radius: 8px;
  margin-top: 25px; /* Space above the section */
  margin-bottom: 20px; /* Space below the section */
  background-color: white;
  overflow: hidden; /* Ensure border radius clips content */
}

.declaration-header {
  background-color: var(--primary-green, #2a9d8f);
  color: white;
  padding: 12px 20px;
  font-weight: 600;
  font-size: 1rem;
  display: flex;
  align-items: center;
}

.declaration-icon {
  margin-right: 10px;
  font-size: 1.2em; /* Adjust icon size as needed */
  line-height: 1;
}

.declaration-list {
  list-style: none;
  padding: 20px;
  margin: 0;
}

.declaration-item {
  display: flex;
  align-items: flex-start; /* Align icon with the start of the text */
  margin-bottom: 15px;
  font-size: 0.9rem;
  line-height: 1.5;
  color: var(--gray-80, #333333);
}

.declaration-item:last-child {
  margin-bottom: 0;
}

.declaration-item-icon {
  color: var(--primary-green, #2a9d8f);
  font-weight: bold;
  margin-right: 10px;
  min-width: 1em; /* Ensure space for the icon */
  line-height: 1.5; /* Match text line-height */
}

/* Adjust the final checkbox label style if needed */
.form-check-label {
    /* Inherits base label styles, add specific overrides here if necessary */
    /* e.g., font-size: 0.9rem; */
}

/* --- Final Declaration Checkbox Container --- */
.final-declaration-check-container {
  padding: 0; /* Ensure no extra padding */
  margin-top: 25px; /* Space above */
  margin-bottom: 20px; /* Space below */
}

/* --- Custom Checkbox Styling --- */
.form-check input[type="checkbox"] {
  accent-color: var(--primary-green, #2a9d8f); /* Use theme color for checked state */
}

/* 自定义复选框焦点样式 */
.form-check input[type="checkbox"]:focus {
  outline: 2px solid rgba(42, 157, 143, 0.25); /* Light outline with theme color */
  outline-offset: 2px;
}

/* Input Error Highlighting */
.input-error {
    border-color: var(--error-red) !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25) !important;
}

.alert-error .input-error {
    border-color: var(--error-red);
}

/* Signature Pad Styling */
.signature-container {
    margin-top: 15px; /* Add some space above the signature area */
}

.signature-pad-wrapper {
    position: relative;
    width: 100%;
    height: 150px; /* Adjust height as needed */
    border: 1px solid #ccc; /* Default border */
    border-radius: 4px;
    background-color: #fff; /* Ensure background is white */
    touch-action: none; /* Prevent scrolling on touch devices when drawing */
    box-sizing: border-box;
    margin-bottom: 5px; /* Space between pad and clear button */
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out; /* For error state */
}

.signature-pad-wrapper.input-error {
    border-color: var(--error-red);
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.25);
}

.signature-canvas {
    display: block;
    width: 100%;
    height: 100%;
    background-color: #fff;
    border-radius: 4px;
}

.clear-signature-btn {
    float: right; /* Position clear button nicely */
    margin-top: 0; /* Align with bottom of wrapper if needed */
} 