.error-message {
  background-color: #ffeaea;
  border: 1px solid #ffcdd2;
  border-radius: 8px;
  padding: 12px 16px;
  margin-bottom: 24px;
  color: #d32f2f;
  font-size: 14px;
  display: none;
}

.error-message.show {
  display: block;
}

.form-group {
  margin-bottom: 20px;
}

.form-row {
  display: flex;
  gap: 15px;
}

.form-row .form-group {
  flex: 1;
}

label {
  display: block;
  margin-bottom: 6px;
  font-weight: 400;
  font-size: 14px;
}

.file-upload-help {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
  line-height: 1.4;
}

.required {
  color: #d32f2f;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="date"],
input[type="file"],
select,
textarea {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--color-grey-3);
  border-radius: 8px;
  font-size: 14px;
  transition: border-color 0.3s, box-shadow 0.3s;
  background-color: #fff;
}

/* iOS Safari용 select 스타일 강제 적용 */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='%23333' d='M0 0l6 8 6-8z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  padding-right: 40px;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary-yellow);
  box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.1);
}

.error {
  border-color: #d32f2f !important;
  box-shadow: 0 0 0 3px rgba(211, 47, 47, 0.1) !important;
}

.error-text {
  color: #d32f2f;
  font-size: 13px;
  margin-top: 4px;
  display: none;
}

textarea {
  min-height: 120px;
  resize: vertical;
}

select {
  cursor: pointer;
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 20px;
}

.checkbox-group input[type="checkbox"] {
  width: auto;
  margin: 0;
}

.checkbox-group label {
  margin-bottom: 0;
  font-weight: normal;
  cursor: pointer;
  flex: 1;
}

.submit-btn {
  width: 100%;
  padding: 16px;
  background-color: var(--color-primary-yellow);
  border: none;
  border-radius: 100px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.3s, transform 0.1s;
  margin-top: 24px;
}

.submit-btn:hover {
  background-color: #ffcd00;
  transform: translateY(-1px);
}

.submit-btn:active {
  transform: translateY(0);
}

.submit-btn:disabled {
  background-color: #ccc;
  cursor: not-allowed;
  transform: none;
}

.privacy-agree{
  display: flex;
  align-items: center;
  gap:.5rem;

  label{
    margin-bottom:0;
  }
}

/* ========================================
   파일 업로드: 드래그앤드롭 영역
   ======================================== */
.file-drop-zone {
  border: 2px dashed var(--color-grey-3);
  border-radius: 12px;
  padding: 32px;
  text-align: center;
  transition: all 0.3s ease;
  background-color: #fafafa;
  cursor: pointer;
  min-height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.file-drop-zone:hover {
  border-color: var(--color-grey-2);
  background-color: #f5f5f5;
}

.file-drop-zone.drag-over {
  border-color: var(--color-primary-yellow);
  background-color: #fffbf0;
  transform: scale(1.02);
  border-width: 3px;
}

.drop-zone-content {
  pointer-events: none;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.drop-zone-content svg {
  margin: 0 auto 8px;
  width: 40px;
  height: 40px;
  color: var(--color-grey-2);
}

.drop-zone-content .upload-icon {
  width: 40px !important;
  height: 40px !important;
}

.drop-zone-content p {
  margin: 4px 0;
}

/* 개선된 업로드 UI */
.improved-upload-zone {
  padding: 16px 20px;
  min-height: 100px;
  background: linear-gradient(135deg, #fafafa 0%, #f5f5f5 100%);
  border: 2px dashed var(--color-grey-3);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.improved-upload-zone:hover {
  border-color: var(--color-primary-yellow, #FFD700);
  background: linear-gradient(135deg, #fffbf0 0%, #fff9e6 100%);
  box-shadow: 0 4px 12px rgba(255, 215, 0, 0.15);
  transform: translateY(-2px);
}

.improved-upload-zone.drag-over {
  border-color: var(--color-primary-yellow, #FFD700);
  background: linear-gradient(135deg, #fffbf0 0%, #fff9e6 100%);
  border-width: 3px;
  box-shadow: 0 8px 24px rgba(255, 215, 0, 0.25);
  transform: scale(1.01) translateY(-2px);
}

.upload-icon-wrapper {
  position: relative;
  margin-bottom: 2px;
}

.upload-icon {
  width: 40px;
  height: 40px;
  color: var(--color-primary-yellow, #FFD700);
  transition: all 0.3s ease;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.improved-upload-zone:hover .upload-icon {
  transform: translateY(-4px) scale(1.1);
  color: var(--color-primary-yellow, #FFD700);
}

.upload-icon-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  background: radial-gradient(circle, rgba(255, 215, 0, 0.1) 0%, transparent 70%);
  border-radius: 50%;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.improved-upload-zone:hover .upload-icon-bg {
  opacity: 1;
}

.upload-text-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
}

.upload-main-text {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-grey-1, #1D1D1C);
  margin: 0;
  line-height: 1.3;
}

.upload-sub-text {
  font-size: 11px;
  color: var(--color-grey-2, #6B7280);
  margin: 0;
  line-height: 1.2;
}

.upload-button {
  margin-top: 4px;
  padding: 8px 18px;
  background-color: var(--color-primary-yellow, #FFD700);
  color: var(--color-grey-1, #1D1D1C);
  border: none;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  pointer-events: auto;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.upload-button:hover {
  background-color: #ffcd00;
  transform: translateY(-1px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.upload-button:active {
  transform: translateY(0);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 업로드 진행 상태 */
.upload-progress {
  margin-top: 16px;
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background-color: var(--color-grey-4, #F3F4F6);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary-yellow, #FFD700) 0%, #ffcd00 100%);
  border-radius: 4px;
  transition: width 0.3s ease;
  width: 0%;
  box-shadow: 0 0 8px rgba(255, 215, 0, 0.5);
}

.progress-text {
  font-size: 12px;
  color: var(--color-grey-2, #6B7280);
  text-align: center;
  font-weight: 500;
}

/* ========================================
   파일 미리보기
   ======================================== */
.file-thumbnail {
  width: 60px;
  height: 60px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--color-grey-3);
  flex-shrink: 0;
}

.pdf-icon,
.file-icon {
  width: 60px;
  height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  background-color: #f5f5f5;
  border-radius: 8px;
  border: 1px solid var(--color-grey-3);
  flex-shrink: 0;
}

/* ========================================
   파일 아이템 표시
   ======================================== */
.file-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: white;
  border: 1px solid var(--color-grey-3);
  border-radius: 8px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.file-item:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.file-info {
  margin-top: 12px;
}

.file-list {
  margin-top: 12px;
}

/* ========================================
   모바일 최적화
   ======================================== */
@media (max-width: 768px) {
  .container {
    margin: 20px;
    padding: 24px;
  }

  .form-row {
    flex-direction: column;
    gap: 0;
  }

  h1 {
    font-size: 20px;
  }

  /* 드래그앤드롭 영역 모바일 조정 */
  .file-drop-zone {
    padding: 24px 16px;
    min-height: 100px;
  }

  .improved-upload-zone {
    padding: 14px 16px;
    min-height: 90px;
  }

  .upload-icon {
    width: 36px;
    height: 36px;
  }

  .upload-main-text {
    font-size: 12px;
  }

  .upload-sub-text {
    font-size: 10px;
  }

  .upload-button {
    padding: 6px 14px;
    font-size: 11px;
  }

  .drop-zone-content svg {
    width: 40px;
    height: 40px;
  }

  .drop-zone-content p {
    font-size: 13px;
  }

  /* 미리보기 썸네일 크기 조정 */
  .file-thumbnail,
  .pdf-icon,
  .file-icon {
    width: 48px;
    height: 48px;
    font-size: 24px;
  }

  /* 파일 아이템 모바일 조정 */
  .file-item {
    flex-wrap: wrap;
    gap: 8px;
    padding: 10px;
  }

  .file-item .file-name {
    flex: 1 1 100%;
    order: 2;
  }

  .file-item .file-size {
    order: 3;
  }

  .file-item button {
    order: 4;
  }

  /* 터치 타겟 최소 크기 보장 (iOS 권장) */
  .file-item button {
    min-width: 44px;
    min-height: 44px;
    padding: 10px !important;
  }
}

/* ========================================
   Document Card Styles (서류 제출 카드)
   ======================================== */

/* 서류 그리드 레이아웃 */
.document-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 24px;
}

/* 개별 서류 카드 */
.document-card {
  background: white;
  border: 2px solid var(--color-grey-3, #E5E7EB);
  border-radius: 12px;
  padding: 20px;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* 필수 서류 카드 */
.document-card.required-doc {
  border-color: #FFD700;
  background: linear-gradient(to bottom, #FFFBF0 0%, white 100%);
}

/* 선택 서류 카드 */
.document-card.optional-doc {
  border-color: var(--color-grey-3, #E5E7EB);
}

/* 카드 호버 효과 */
.document-card:hover {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
  transform: translateY(-2px);
}

/* 카드 헤더 */
.document-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 서류 아이콘 */
.document-icon {
  font-size: 32px;
  line-height: 1;
  flex-shrink: 0;
}

/* 제목 래퍼 */
.document-title-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* 서류 제목 */
.document-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-grey-1, #1D1D1C);
  margin: 0;
  line-height: 1.4;
}

/* 필수/선택 배지 */
.required-badge,
.optional-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.required-badge {
  background-color: #FFD700;
  color: #1D1D1C;
}

.optional-badge {
  background-color: var(--color-grey-4, #F3F4F6);
  color: var(--color-grey-2, #6B7280);
}

/* 카드 바디 (업로드 영역) */
.document-card-body {
  flex: 1;
}

/* 카드 바디 내부의 form-group 스타일 재정의 */
.document-card-body .form-group {
  margin-bottom: 0;
}

.document-card-body .form-group label {
  display: none; /* 카드 헤더에 이미 제목이 있으므로 숨김 */
}

/* 메타 정보 (파일 형식 안내) */
.document-meta {
  padding-top: 12px;
  border-top: 1px solid var(--color-grey-4, #F3F4F6);
}

.document-meta small {
  color: var(--color-grey-2, #6B7280);
  font-size: 13px;
  line-height: 1.5;
}

/* 서명 카드 - 전체 너비 */
.signature-card {
  grid-column: 1 / -1;
}

/* 업로드 완료 체크마크 */
.upload-complete-check {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  background-color: #10B981;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-center;
  animation: checkmarkPop 0.3s ease-out;
  z-index: 10;
}

.upload-complete-check::after {
  content: "✓";
  color: white;
  font-size: 14px;
  font-weight: bold;
}

@keyframes checkmarkPop {
  0% {
    transform: scale(0);
    opacity: 0;
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* 드래그 존 카드 내부 조정 */
.document-card .file-drop-zone {
  min-height: 140px;
  padding: 24px;
}

/* 반응형: 모바일 */
@media (max-width: 767px) {
  .document-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .document-card {
    padding: 16px;
    gap: 12px;
  }

  .document-icon {
    font-size: 28px;
  }

  .document-title {
    font-size: 15px;
  }

  .document-card .file-drop-zone {
    min-height: 120px;
    padding: 20px;
  }

  .signature-card {
    grid-column: 1;
  }
}
