/* Application Form Specific Styles */

/* Reset checkbox and radio default styles */
input[type="checkbox"],
input[type="radio"] {
    margin: 0;
    padding: 0;
}

.form-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 5rem 1.5rem 3rem;
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid var(--secondary-color);
}

.form-header h1 {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.form-description {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
}

/* Form Sections */
.form-section {
    background: white;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    padding: 1.25rem;
    margin-bottom: 1.25rem;
    transition: box-shadow 0.3s ease;
}

.form-section:hover {
    box-shadow: 0 2px 8px rgba(148, 128, 197, 0.08);
}

.form-section.highlight-section {
    background: linear-gradient(135deg, #f8f6fc 0%, #ffffff 100%);
    border: 2px solid var(--primary-color);
}

.form-section.privacy-section {
    background: #fafafa;
    border: 2px dashed var(--secondary-color);
    padding: 0.5rem; /* 0.75rem → 0.5rem (33% 추가 축소) */
}

.form-section.privacy-section .form-group {
    margin-bottom: 0; /* 하단 마진 제거 */
}

.form-section.privacy-section .checkbox-group {
    gap: 0; /* 체크박스 간 간격 제거 */
}

.form-section.privacy-section .checkbox-label {
    padding: 0.4rem;
    align-items: center !important;
    margin-bottom: 0 !important;
}

.form-section.privacy-section .checkbox-label span {
    top: 0 !important;
}

.form-section.privacy-section .checkbox-label input[type="checkbox"] {
    margin-top: 3px; /* 1px → 3px로 더 아래로 */
}

/* Section Header */
.section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #f0f0f0;
}

.section-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    border-radius: 50%;
    font-weight: 700;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.section-header h2 {
    font-size: 1.1rem;
    color: #333;
    margin: 0;
    font-weight: 600;
}

.section-description {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
    padding: 0.75rem;
    background: #f9f9f9;
    border-radius: 6px;
    font-size: 0.85rem;
}

.subsection-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 1rem 0 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid #e8e8e8;
}

/* Form Groups */
.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: #333;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="tel"],
.form-group input[type="number"],
.form-group input[type="date"],
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    font-size: 0.9rem;
    font-family: 'Pretendard', sans-serif;
    transition: all 0.3s ease;
    background: white;
    vertical-align: top;
    resize: vertical;
}

/* Select dropdown styling */
.form-group select {
    padding-right: 2.5rem; /* 오른쪽 패딩 증가 */
    appearance: none; /* 기본 화살표 제거 */
    background-image: url('data:image/svg+xml;charset=UTF-8,%3Csvg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12"%3E%3Cpath fill="%23666" d="M6 9L1 4h10z"/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 0.85rem center; /* 오른쪽에서 0.85rem 간격 */
    background-size: 12px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(148, 128, 197, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
    line-height: 1.6;
}

.form-group small {
    display: block;
    margin-top: 0.35rem;
    color: #777;
    font-size: 0.8rem;
}

/* Score Group */
.score-group {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}

@media (max-width: 768px) {
    .score-group {
        grid-template-columns: repeat(2, 1fr);
    }
}

.score-group .form-group {
    margin-bottom: 0;
}

/* Checkbox and Radio Groups */
.checkbox-group,
.radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

/* 같은 form-group 내의 라디오 버튼 간격 좁히기 */
.form-group .radio-label + .radio-label {
    margin-top: 0.3rem; /* 간격 축소 */
}

.checkbox-label,
.radio-label {
    display: flex !important;
    align-items: flex-start !important; /* 강제 적용 */
    gap: 0.6rem;
    cursor: pointer;
    padding: 0.6rem;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.checkbox-label:hover,
.radio-label:hover {
    background: #f5f5f5;
}

.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    margin-top: 0; /* 2px → 0으로 변경 */
    cursor: pointer;
    flex-shrink: 0;
    vertical-align: top; /* 추가 */
}

.checkbox-label span,
.radio-label span {
    font-size: 0.9rem;
    color: #333;
    line-height: 1.5;
    flex: 1;
    padding-top: 0;
    display: inline-block;
    position: relative;
    top: -4.5px; /* 텍스트를 위로 4.5px 이동 */
}

/* Writing Prompts */
.writing-prompt {
    background: white;
    border: 2px solid var(--accent-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.prompt-number {
    display: inline-block;
    background: var(--accent-color);
    color: white;
    padding: 0.3rem 0.75rem;
    border-radius: 15px;
    font-weight: 600;
    font-size: 0.8rem;
    margin-bottom: 0.75rem;
}

.prompt-text {
    font-size: 0.95rem;
    color: #333;
    font-weight: 500;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* Info Text */
.info-text {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.75rem;
    background: #fff8e1;
    border-left: 3px solid #ffc107;
    border-radius: 6px;
    color: #666;
    font-size: 0.85rem;
    margin-top: 0.75rem;
}

.info-text i {
    color: #ffc107;
    font-size: 1rem;
}

/* Privacy Policy Link */
#privacyPolicyLink {
    color: var(--primary-color);
    text-decoration: underline;
    font-weight: 500;
}

#privacyPolicyLink:hover {
    color: var(--accent-color);
}

/* Form Actions */
.form-actions {
    display: flex;
    justify-content: center; /* 중앙 정렬 */
    gap: 1rem;
    margin-top: 2.5rem;
    padding-top: 2rem;
    border-top: 2px solid #e8e8e8;
}

.btn-primary,
.btn-secondary {
    padding: 0.85rem 2rem; /* 패딩 조정 */
    border: none;
    border-radius: 8px; /* 더 둥글게 */
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Pretendard', sans-serif;
    min-width: 140px; /* 최소 너비 설정 */
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    color: white;
    box-shadow: 0 4px 12px rgba(148, 128, 197, 0.2); /* 그림자 추가 */
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(148, 128, 197, 0.35);
}

.btn-secondary {
    background: white;
    color: #666;
    border: 2px solid #e0e0e0;
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #ccc;
    transform: translateY(-1px);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 1.5rem;
    border-radius: 10px;
    max-width: 550px;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-close {
    position: absolute;
    right: 1.25rem;
    top: 1.25rem;
    font-size: 1.75rem;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: #333;
}

/* Success Modal */
.success-modal {
    text-align: center;
    padding: 2rem 1.5rem;
}

.success-icon {
    font-size: 3.5rem;
    color: var(--accent-color);
    margin-bottom: 1rem;
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.success-modal h2 {
    font-size: 1.4rem;
    color: #333;
    margin-bottom: 0.75rem;
}

.success-modal p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.6;
    margin-bottom: 0.75rem;
}

.reminder-text {
    color: #ff6b6b;
    font-weight: 600;
    padding: 0.75rem;
    background: #fff5f5;
    border-radius: 6px;
    margin: 1rem 0;
    font-size: 0.85rem;
}

.success-modal .btn-primary {
    margin-top: 0.75rem;
    display: inline-flex;
}

/* Privacy Content */
.privacy-content {
    line-height: 1.6;
    color: #555;
    font-size: 0.85rem;
}

.privacy-content h3 {
    color: var(--primary-color);
    font-size: 1rem;
    margin-top: 1.25rem;
    margin-bottom: 0.6rem;
}

.privacy-content ul {
    margin-left: 1.25rem;
    margin-bottom: 0.75rem;
}

.privacy-content li {
    margin-bottom: 0.4rem;
}

.privacy-content p {
    margin-bottom: 0.75rem;
}

/* Two Column Layout for Related Fields */
.two-column-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .two-column-grid {
        grid-template-columns: 1fr;
    }
}

.three-column-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

@media (max-width: 768px) {
    .three-column-grid {
        grid-template-columns: 1fr;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-container {
        padding: 4.5rem 1rem 2rem;
    }

    .form-header h1 {
        font-size: 1.5rem;
    }

    .form-description {
        font-size: 0.85rem;
    }

    .form-section {
        padding: 1rem;
    }

    .section-header {
        gap: 0.6rem;
    }

    .section-number {
        width: 28px;
        height: 28px;
        font-size: 0.85rem;
    }

    .section-header h2 {
        font-size: 1rem;
    }

    .score-group {
        grid-template-columns: 1fr 1fr;
    }

    .form-actions {
        flex-direction: column;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        justify-content: center;
        padding: 0.7rem 1.25rem;
    }

    .modal-content {
        margin: 10% 1rem;
        max-width: 100%;
        padding: 1.25rem;
    }

    .success-icon {
        font-size: 3rem;
    }

    .success-modal h2 {
        font-size: 1.25rem;
    }

    .success-modal p {
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .form-header h1 {
        font-size: 1.35rem;
    }

    .form-section {
        padding: 0.85rem;
    }

    .section-header h2 {
        font-size: 0.95rem;
    }

    .score-group {
        grid-template-columns: 1fr;
    }

    .writing-prompt {
        padding: 0.85rem;
    }

    .prompt-text {
        font-size: 0.9rem;
    }
}

/* Loading State */
.form-section.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Error States */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #ff6b6b;
}

.error-message {
    color: #ff6b6b;
    font-size: 0.9rem;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.error-message i {
    font-size: 1rem;
}

/* Required Field Indicator */
.form-group label::after {
    content: '';
}

label:has(+ input[required])::after,
label:has(+ select[required])::after,
label:has(+ textarea[required])::after,
.form-group:has(input[required]) > label::after,
.form-group:has(select[required]) > label::after,
.form-group:has(textarea[required]) > label::after {
    content: ' *';
    color: #ff4444;
    font-weight: 700;
}

/* Tab system for score/target versions */
.version-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 1.25rem;
    border-bottom: 2px solid #e8e8e8;
}

.version-tab {
    flex: 1;
    padding: 0.75rem 1rem;
    background: white;
    border: none;
    border-bottom: 3px solid transparent;
    font-size: 0.9rem;
    font-weight: 600;
    color: #999;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Pretendard', sans-serif;
}

.version-tab:hover {
    color: var(--primary-color);
    background: #f8f6fc;
}

.version-tab.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
    background: #f8f6fc;
}

.version-content {
    display: none;
}

.version-content.active {
    display: block;
}

/* Clean writing section - less colorful */
.writing-section-clean {
    background: white !important;
    border: 1px solid #e8e8e8 !important;
}

.writing-section-clean .section-description {
    background: #f9f9f9;
    border-left: 3px solid #9480c5;
}

.writing-section-clean .writing-prompt {
    background: #fafafa;
    border: 1px solid #e0e0e0;
}

.writing-section-clean .prompt-number {
    background: #9480c5;
}
