/* ================================================
   파트너 신청서 - 메인 스타일
   심플하고 깔끔한 디자인
   ================================================ */

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --primary: #1a56db;
  --primary-light: #e8f0fe;
  --primary-dark: #1344b0;
  --accent: #2563eb;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --red-500: #ef4444;
  --green-500: #10b981;
  --border-radius: 8px;
  --border-radius-lg: 12px;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
  --shadow-lg: 0 10px 30px rgba(0,0,0,0.10), 0 4px 10px rgba(0,0,0,0.05);
  --transition: 0.2s ease;
  --font: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, sans-serif;
}

body {
  font-family: var(--font);
  background: linear-gradient(135deg, #f0f4ff 0%, #e8f0fe 50%, #f5f7ff 100%);
  min-height: 100vh;
  color: var(--gray-800);
  font-size: 14px;
  line-height: 1.6;
}

/* ---- 페이지 래퍼 ---- */
.page-wrapper {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 16px 48px;
}

/* ---- 헤더 ---- */
.form-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  padding: 0 4px;
}

.form-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--gray-900);
  letter-spacing: -0.5px;
}

.form-title::after {
  content: '';
  display: block;
  width: 40px;
  height: 3px;
  background: var(--primary);
  margin-top: 6px;
  border-radius: 2px;
}

/* SOFTCAMP CI 로고 (data-logo 주입) */
.ci-logo { display: inline-flex; align-items: center; line-height: 0; }
.ci-logo svg { height: 100%; width: auto; display: block; }
.brand-bar { padding: 2px 4px 16px; }
.brand-bar .ci-logo { height: 26px; color: var(--gray-900); }

.form-date {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--gray-600);
}

.date-input {
  border: 1px solid var(--gray-300);
  border-radius: var(--border-radius);
  padding: 6px 10px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--gray-700);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

.date-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.12);
}

/* ---- 단계별 / 전체 펼치기 도구줄 ---- */
.form-mode-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  margin-bottom: 20px;
  padding: 10px 18px;
  background: #fff;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

.expand-all-toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
}

.expand-all-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.expand-all-track {
  position: relative;
  width: 44px;
  height: 24px;
  border-radius: 999px;
  background: var(--gray-300);
  transition: background var(--transition);
  flex-shrink: 0;
}

.expand-all-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: transform var(--transition);
}

.expand-all-toggle input:focus-visible + .expand-all-track {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.expand-all-toggle input:checked + .expand-all-track {
  background: var(--primary);
}

.expand-all-toggle input:checked + .expand-all-track::after {
  transform: translateX(20px);
}

.wizard-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
}

.wizard-panel-bottom.wizard-panel {
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}

.wizard-panel-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px 20px;
  width: 100%;
}

/* 폼 하단 단계 바 (전체 펼치기 시 숨김) */
.wizard-panel-bottom {
  margin-top: 0;
  margin-bottom: 20px;
  padding: 16px 18px;
  background: #fff;
  border-radius: var(--border-radius-lg);
  border: 1px solid var(--gray-200);
  box-shadow: var(--shadow-sm);
}

#partnerForm.form-expand-all .wizard-panel-bottom {
  display: none !important;
}

.wizard-progress {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
}

.wizard-step-count {
  font-size: 13px;
  font-weight: 700;
  color: var(--primary);
  min-width: 3.5em;
}

.wizard-step-name {
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
}

.wizard-step-picker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding-top: 14px;
  margin-top: 12px;
  border-top: 1px solid var(--gray-200);
}

.wizard-step-num {
  box-sizing: border-box;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  font-size: 13px;
  font-weight: 600;
  font-family: var(--font);
  line-height: 1;
  color: var(--gray-600);
  background: var(--gray-100);
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition), box-shadow var(--transition);
}

.wizard-step-num:hover {
  background: var(--gray-200);
  color: var(--gray-800);
}

.wizard-step-num:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.wizard-step-num.is-current {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.wizard-step-num.is-current:hover {
  background: var(--primary-dark);
  border-color: var(--primary-dark);
  color: #fff;
}

.wizard-nav-btns {
  display: flex;
  gap: 8px;
}

.btn-wizard {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: var(--border-radius);
  font-family: var(--font);
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all var(--transition);
  border: 1px solid transparent;
}

.btn-wizard-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
  border-color: var(--gray-200);
}

.btn-wizard-secondary:hover:not(:disabled) {
  background: var(--gray-200);
}

.btn-wizard-primary {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.btn-wizard-primary:hover:not(:disabled) {
  background: var(--primary-dark);
}

.btn-wizard:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* 단계별: 현재 단계만 표시 */
#partnerForm.form-wizard-mode:not(.form-expand-all) .form-section:not(.is-active-step),
#partnerForm.form-wizard-mode:not(.form-expand-all) .form-actions:not(.is-active-step) {
  display: none !important;
}

#partnerForm.form-wizard-mode:not(.form-expand-all) .form-actions.is-active-step {
  display: flex !important;
}

/* ---- 섹션 공통 ---- */
.form-section {
  background: #fff;
  border-radius: var(--border-radius-lg);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
  border: 1px solid var(--gray-200);
  transition: box-shadow var(--transition);
}

.form-section:hover {
  box-shadow: var(--shadow-md);
}

.section-title-bar {
  background: var(--gray-50);
  border-bottom: 1px solid var(--gray-200);
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  letter-spacing: 0.3px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.section-title-bar::before {
  content: '';
  display: inline-block;
  width: 4px;
  height: 14px;
  background: var(--primary);
  border-radius: 2px;
}

/* ---- 파트너 유형 섹션 ---- */
.partner-type-row {
  display: flex;
  align-items: stretch;
  min-height: 80px;
}

.label-cell {
  background: var(--gray-50);
  border-right: 1px solid var(--gray-200);
  padding: 16px 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.wide-label {
  min-width: 120px;
}

.content-cell {
  padding: 16px 20px;
  flex: 1;
  display: flex;
  align-items: center;
}

/* ---- 그리드 폼 ---- */
.grid-form {
  padding: 8px 0;
}

.form-row {
  display: flex;
  align-items: center;
  border-bottom: 1px solid var(--gray-100);
  min-height: 48px;
}

.form-row:last-child {
  border-bottom: none;
}

.form-row.align-top {
  align-items: flex-start;
  padding: 12px 0;
}

.field-label {
  min-width: 140px;
  padding: 12px 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  background: var(--gray-50);
  border-right: 1px solid var(--gray-100);
  align-self: stretch;
  display: flex;
  align-items: center;
  white-space: nowrap;
}

.field-input {
  padding: 8px 16px;
  flex: 1;
  display: flex;
  align-items: center;
}

.field-input.long {
  flex: 2;
  border-right: 1px solid var(--gray-100);
}

.field-input.full {
  flex: 1;
}

/* ---- 입력 요소 공통 ---- */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="url"],
input[type="tel"],
textarea {
  width: 100%;
  border: 1px solid var(--gray-200);
  border-radius: 6px;
  padding: 8px 12px;
  font-size: 13px;
  font-family: var(--font);
  color: var(--gray-800);
  background: #fff;
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: var(--gray-400);
  font-size: 12px;
}

input:focus,
textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(26, 86, 219, 0.10);
}

textarea {
  resize: vertical;
  min-height: 72px;
  line-height: 1.5;
}

/* ---- 전담 인력 분할 ---- */
.staff-split {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.staff-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.staff-item label {
  font-size: 13px;
  color: var(--gray-600);
  white-space: nowrap;
  min-width: 40px;
}

.staff-item input {
  width: 70px;
}

.staff-item span {
  color: var(--gray-500);
  font-size: 13px;
}

/* ---- 체크박스 / 라디오 커스텀 ---- */
.checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.checkbox-group.vertical {
  flex-direction: column;
  gap: 10px;
}

.checkbox-group.horizontal {
  flex-direction: row;
  gap: 20px;
}

.checkbox-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--gray-700);
  user-select: none;
  padding: 2px 0;
}

.checkbox-item input[type="checkbox"],
.checkbox-item input[type="radio"] {
  display: none;
}

.checkmark,
.radiomark {
  width: 18px;
  height: 18px;
  border: 2px solid var(--gray-300);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
  background: #fff;
}

.radiomark {
  border-radius: 50%;
}

.checkbox-item input[type="checkbox"]:checked ~ .checkmark {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-item input[type="checkbox"]:checked ~ .checkmark::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: block;
}

.checkbox-item input[type="radio"]:checked ~ .radiomark {
  border-color: var(--primary);
}

.checkbox-item input[type="radio"]:checked ~ .radiomark::after {
  content: '';
  width: 8px;
  height: 8px;
  background: var(--primary);
  border-radius: 50%;
  display: block;
}

.checkbox-item:hover .checkmark,
.checkbox-item:hover .radiomark {
  border-color: var(--primary);
}

/* ---- 체크 그룹 섹션 ---- */
.check-group-section {
  display: flex;
  align-items: flex-start;
  padding: 14px 20px;
  border-bottom: 1px solid var(--gray-100);
  gap: 16px;
}

.check-group-section:last-child {
  border-bottom: none;
}

.check-group-label {
  min-width: 160px;
  font-size: 13px;
  font-weight: 500;
  color: var(--gray-600);
  padding-top: 2px;
}

.check-options {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  flex: 1;
}

/* ---- 업무담당 테이블 ---- */
.contact-table-wrapper {
  padding: 16px 20px;
  overflow-x: auto;
}

.contact-table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  min-width: 760px;
}

.contact-col-div { width: 9%; max-width: 96px; }
.contact-col-dept { width: 14%; }
.contact-col-name { width: 11%; }
.contact-col-title { width: 8%; max-width: 88px; }
.contact-col-phone { width: 18%; min-width: 136px; }
.contact-col-email { width: 24%; min-width: 200px; }
.contact-col-fax { width: 12%; }

.contact-table th {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-600);
  text-align: center;
  white-space: nowrap;
}

.contact-th-div {
  white-space: normal;
  line-height: 1.25;
}

.contact-table input[name="contactDiv[]"]::placeholder {
  color: var(--gray-400);
  opacity: 1;
  font-size: 11px;
  font-weight: 500;
}

/* 포커스 시 placeholder 숨김 (일부 브라우저에서 포커스 후에도 보이는 경우 대비) */
.contact-table input[name="contactDiv[]"]:focus::placeholder {
  color: transparent;
  opacity: 0;
}

.contact-table input[name="contactDiv[]"]:focus::-webkit-input-placeholder {
  color: transparent;
  opacity: 0;
}

.contact-table input[name="contactDiv[]"]:focus::-moz-placeholder {
  color: transparent;
  opacity: 0;
}

.contact-table td {
  border: 1px solid var(--gray-200);
  padding: 6px 8px;
  vertical-align: middle;
}

.contact-table td input {
  border: 1px solid transparent;
  border-radius: 4px;
  padding: 6px 8px;
  font-size: 12px;
  background: transparent;
  transition: all var(--transition);
}

.contact-table td input:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 2px rgba(26, 86, 219, 0.08);
}

.add-row-btn {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  background: transparent;
  border: 1px dashed var(--gray-300);
  border-radius: 6px;
  font-size: 12px;
  color: var(--gray-500);
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
}

.add-row-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}

/* ---- 비고 섹션 ---- */
.notice-content {
  padding: 20px;
}

.notice-content ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notice-content ul li {
  font-size: 13px;
  color: var(--gray-600);
  padding-left: 20px;
  position: relative;
  line-height: 1.6;
}

.notice-content ul li::before {
  content: '•';
  position: absolute;
  left: 6px;
  color: var(--primary);
  font-weight: bold;
}

.notice-emphasis {
  margin-top: 14px;
  font-size: 13px;
  color: var(--gray-700);
  font-weight: 500;
  padding: 10px 14px;
  background: var(--primary-light);
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
}

/* ---- 버튼 ---- */
.form-actions {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-top: 28px;
  padding: 0 4px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 28px;
  border-radius: var(--border-radius);
  font-size: 14px;
  font-weight: 500;
  font-family: var(--font);
  cursor: pointer;
  border: none;
  transition: all var(--transition);
  letter-spacing: 0.2px;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26, 86, 219, 0.3);
}

.btn-primary:hover {
  background: var(--primary-dark);
  box-shadow: 0 4px 14px rgba(26, 86, 219, 0.4);
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--gray-100);
  color: var(--gray-700);
}

.btn-secondary:hover {
  background: var(--gray-200);
}

.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}

.btn-outline:hover {
  background: var(--primary-light);
}

/* ---- 토스트 알림 ---- */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--gray-900);
  color: #fff;
  padding: 12px 24px;
  border-radius: 50px;
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  pointer-events: none;
  transition: all 0.3s ease;
  z-index: 1000;
  white-space: nowrap;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.toast.success {
  background: var(--green-500);
}

.toast.error {
  background: var(--red-500);
}

/* ---- 푸터 ---- */
.form-footer {
  text-align: center;
  margin-top: 32px;
  color: var(--gray-400);
  font-size: 12px;
}

/* ---- 인쇄 스타일 ---- */
@media print {
  body {
    background: #fff;
  }
  .page-wrapper {
    max-width: 100%;
    padding: 0;
  }
  .form-mode-bar,
  .wizard-panel-bottom {
    display: none !important;
  }
  #partnerForm.form-wizard-mode .form-section {
    display: block !important;
  }
  .form-actions,
  .add-row-btn,
  .form-footer {
    display: none !important;
  }
  .form-section {
    box-shadow: none;
    border: 1px solid #ccc;
    break-inside: avoid;
    margin-bottom: 12px;
  }
  input, textarea {
    border: none !important;
    box-shadow: none !important;
  }
}

/* ---- 반응형 ---- */
/* ---- 필수 제출 서류 업로드 ---- */
.required-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 600;
  color: #b91c1c;
  background: #fee2e2;
  border-radius: 999px;
  vertical-align: middle;
}

.upload-section-hint {
  font-size: 12px;
  color: var(--gray-500);
  margin: 0 0 14px 4px;
}

.upload-grid {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 4px 0 8px;
}

.upload-field {
  background: var(--gray-50);
  border: 1px solid var(--gray-200);
  border-radius: var(--border-radius);
  padding: 14px 16px;
}

.upload-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  margin-bottom: 8px;
}

.upload-label .req {
  color: var(--red-500);
}

.upload-label-hint {
  font-weight: 400;
  font-size: 12px;
  color: var(--gray-500);
}

.upload-input {
  display: block;
  width: 100%;
  font-size: 13px;
  margin-bottom: 6px;
}

.upload-filename {
  display: block;
  font-size: 12px;
  color: var(--gray-500);
  word-break: break-all;
}

.upload-finance-rows {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.upload-finance-row {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px 12px;
  align-items: center;
}

.upload-finance-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--gray-600);
}

.upload-finance-row .upload-input {
  grid-column: 2;
}

.upload-finance-row .upload-filename {
  grid-column: 2;
}

@media (max-width: 768px) {
  .form-mode-bar {
    flex-direction: column;
    align-items: stretch;
  }
  .expand-all-toggle {
    align-self: flex-end;
  }
  .wizard-panel-bottom {
    flex-direction: column;
    align-items: stretch;
  }
  .wizard-nav-btns {
    justify-content: stretch;
    width: 100%;
  }
  .wizard-nav-btns .btn-wizard {
    flex: 1;
    justify-content: center;
  }
  .form-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .form-title {
    font-size: 22px;
  }

  .form-row {
    flex-wrap: wrap;
  }

  .field-label {
    min-width: 100%;
    border-right: none;
    border-bottom: 1px solid var(--gray-100);
  }

  .field-input.long,
  .field-input.full,
  .field-input {
    flex: 1 1 100%;
  }

  .check-group-section {
    flex-direction: column;
    gap: 10px;
  }

  .check-group-label {
    min-width: unset;
  }

  .check-options {
    gap: 12px;
  }

  .staff-split {
    gap: 10px;
  }

  .partner-type-row {
    flex-direction: column;
  }

  .label-cell {
    border-right: none;
    border-bottom: 1px solid var(--gray-200);
    min-width: unset;
  }

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

  .btn {
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .page-wrapper {
    padding: 16px 12px 40px;
  }

  .form-title {
    font-size: 20px;
  }

  .checkbox-group.horizontal {
    flex-direction: column;
    gap: 10px;
  }
}
