/* ===== base ===== */
* { box-sizing: border-box; }
body { margin: 0; font-family: system-ui, -apple-system, Segoe UI, Roboto, "Noto Sans KR", sans-serif; }

:root{
  --modal-radius: 24px;
  --line: #d9d9d9;
  --th-bg: #f2f2f2;
  --text: #111;
  --muted: #666;
  --green: #2f6f4e;
}

/* ===== modal layout ===== */
.modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.modal.is-open{ display: block; }

.modal__dim{
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index:0;
}

/* PC: centered large card */
.modal__panel{
  position: relative;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 48px 16px;
}

.modal__inner{
  width: min(980px, 100%);
  background: #fff;
  border-radius: var(--modal-radius);
  box-shadow: 0 20px 80px rgba(0,0,0,.35);
  overflow: hidden;
}

.modal__header{
  padding: 34px 24px 8px;
  position: relative;
}
.modal__title{
  margin: 0;
  text-align: center;
  font-size: 42px;
  font-weight: 800;
  color: var(--text);
}

/* top divider line (as in design) */
.modal__body{
  padding: 10px 24px 28px;
}
.modal__body::before{
  content:"";
  display:block;
  height: 2px;
  background: #111;
  margin: 0 0 18px 0;
}

/* ===== form-table ===== */
.form-table{
  border: 1px solid var(--line);
  border-left: none;
  border-right: none;
}

.form-row{
  display: grid;
  grid-template-columns: 110px 1fr 110px 1fr;
  border-top: 1px solid var(--line);
}
.form-row:first-child{ border-top: none; }

.form-th{
  padding: 18px 16px;
  background: var(--th-bg);
  color: #333;
  font-weight: 700;
  font-size: 15px;
  border-right: 1px solid var(--line);
  display:flex;
  align-items:center;
  gap: 4px;
}
.form-td{
  padding: 12px 14px;
  border-right: 1px solid var(--line);
  display:flex;
  align-items:center;
}
.form-row > :nth-child(4){ border-right: none; } /* last td */

.req{ color:#111; font-weight: 800; }

.form-td input,
.form-td textarea{
  width: 100%;
  border: none;
  outline: none;
  font-size: 15px;
  color: var(--text);
  background: transparent;
}
.form-td textarea{
  resize: vertical;
  min-height: 180px; /* PC에서 큰 상담내용 영역 */
}

/* 상담내용은 오른쪽이 넓게 1칸만 쓰는 구조 */
.form-row--message{
  grid-template-columns: 110px 1fr;
}
.form-row--message .form-th{
  border-right: 1px solid var(--line);
}
.form-row--message .form-td{
  border-right: none;
}

/* ===== privacy ===== */
.privacy-box{
  margin-top: 18px;
  border: 1px solid #e6e6e6;
  background: #fafafa;
  padding: 18px 18px;
}
.privacy-box__title{
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: 800;
  color: #555;
}
.privacy-box__content{
  color: #777;
  font-size: 12.5px;
  line-height: 1.6;
}
.privacy-box__content p{ margin: 0 0 10px; }
.privacy-box__content ol{ margin: 0 0 10px 18px; padding: 0; }

/* ===== actions (checkbox + button) ===== */
.form-actions{
  display:flex;
  align-items:center;
  justify-content: space-between;  /* PC: 체크 왼쪽, 버튼 오른쪽 느낌 */
  gap: 16px;
  margin-top: 18px;
}
.check{
  display:flex;
  align-items:center;
  gap: 10px;
  color: #222;
  font-weight: 700;
  font-size: 14px;
}
.check input{ width: 18px; height: 18px; }

.btn-submit{
  width: 260px;
  height: 54px;
  border: none;
  border-radius: 10px;
  background: var(--green);
  color: #fff;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}
.btn-submit:active{ transform: translateY(1px); }

.modal__close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 32px;
    height: 32px;
    padding: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 28px;
    line-height: 1;
    color: #6b7280;
}

/* ===== MOBILE: full screen modal ===== */
@media (max-width: 768px){

.modal__close {
    top: 10px;
    right: 10px;
}

  .modal__panel{
    padding: 0;          /* 화면 꽉차게 */
    place-items: stretch;
  }
  .modal__inner{
    width: 100%;
    height: 100%;
    border-radius: 0;     /* 모바일은 풀스크린 */
  }

  .modal__header{
    padding: 26px 16px 6px;
  }
  .modal__title{
    font-size: 20px;
    font-weight: 800;
  }

  .modal__body{
    padding: 10px 16px 18px;
  }

  /* 모바일: 라벨(좌) + 입력(우) 2컬럼으로 쌓이게 */
  .form-row{
    grid-template-columns: 95px 1fr;
  }


  /* 모바일에서 소속/메일주소는 별도 행으로 다시 구성하고 싶다면:
     - HTML에서 form-row를 모바일 전용으로 나누는 방식 권장 (현재는 간단 구현) */

  .form-td textarea{
    min-height: 80px;
  }

  .form-actions{
    flex-direction: column;
    align-items: stretch;
  }
  .btn-submit{
    width: 100%;
    height: 52px;
    border-radius: 10px;
  }
}




/* ===== modal layout (공통) ===== */
.modal{
  position: fixed;
  inset: 0;
  display: none;
  z-index: 9999;
}
.modal.is-open{ display:block; }

/* 패널: 화면 가운데 배치 + 바깥은 스크롤 가능(작은 화면/키보드 대응) */
.modal__panel{
  position: relative;
  height: 100%;
  display: grid;
  place-items: center;
  padding: 48px 16px;
  overflow: auto;               
  -webkit-overflow-scrolling: touch;
  z-index:1;
}



/* PC 기본 카드 */
.modal__inner{
  width: min(980px, 100%);
  background:#fff;
  border-radius: 24px;
  box-shadow: 0 20px 80px rgba(0,0,0,.35);
  overflow: hidden;
}

/* ===== 내용 스크롤 영역 ===== */
.modal__body{
  padding: 10px 24px 28px;
  
  
  -webkit-overflow-scrolling: touch;
}

.modal__body::before{
  content:"";
  display:block;
  height: 2px;
  background:#111;
  margin: 0 0 18px 0;
}

/* ===== MOBILE: 풀스크린 금지 + 카드 유지 + 내부 스크롤 ===== */
@media (max-width: 768px){
  /* .modal__panel{
    padding: 24px 14px;         
    place-items: start center;     
  } */

.modal__panel{
  height: 100%;
  display: grid;
  place-items: center;
  padding: 100px 16px 48px; /* top만 100px로 */
  overflow: auto;
}
.privacy-box {
    margin-top: 18px;
    border: 1px solid #e6e6e6;
    background: #fafafa;
    padding: 18px 18px;
    max-height:120px;
    overflow: auto;
}
  .modal__inner{
    width: min(520px, 100%);       /* 모바일에서도 카드 폭 제한 */
    border-radius: 22px;           
    overflow: auto;
  }

  .modal__header{
    padding: 22px 16px 6px;
  }
  .modal__title{
    font-size: 20px;
    font-weight: 800;
    text-align:center;
  }

  .modal__body{
    padding: 10px 16px 18px;
    max-height: calc(100vh - 110px); /* 모바일: 화면에서 헤더 감안하고 내부 스크롤 */
  }

  /* 모바일 폼 테이블은 필요에 맞게 유지/수정 */
  .form-actions{
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .btn-submit{
    width: 100%;
  }



  /* 4칸(성명/입력/소속/입력)을 "2열 그리드"로 바꿔서
     (라벨+입력) 세트가 한 줄씩 나오도록 */
  .form-row{
    grid-template-columns: 95px 1fr; /* 라벨 / 입력 */
  }

  /* 기존에 숨겼던 소속/메일주소 표시되게 복구 */
  .form-row .form-th:nth-child(3),
  .form-row .form-td:nth-child(4){
    display: flex; /* 또는 display:block */
  }

  /* 3번째 라벨(소속/메일주소)을 다음 줄로 내림 */
  .form-row .form-th:nth-child(3){
    grid-column: 1;
  }
  .form-row .form-td:nth-child(4){
    grid-column: 2;
  }

  /* (선택) border 정리: 모바일에서 오른쪽 border 어색하면 제거 */
  .form-td{
    border-right: none;
  }
.form-table > .form-row:first-child > .form-th:nth-child(3),
.form-table > .form-row:first-child > .form-td:nth-child(4){
  border-top: 1px solid var(--line);
}
.form-table > .form-row:nth-child(2) > .form-th:nth-child(3),
.form-table > .form-row:nth-child(2)  > .form-td:nth-child(4){
  border-top: 1px solid var(--line);
}
.form-th {
    padding: 18px 11px;
}










}
