/* 지원서 (/careers/apply[/{번호}]) — 개편 모양. 칸 이름 · 검사 · 보내기는 예전 지원서 그대로 (careers-apply.js).
 * 동의 · 오른쪽 상자 · 제출 · 보낸 뒤 화면은 careers-apply-submit.css.
 * 넓은 화면(1000px~)은 왼쪽 폼 + 오른쪽에 붙는 상자(지원 포지션 · 항목 목차 · 필수 안내 · 제출), 좁은 화면은 한 줄 + 아래에 붙는 제출 막대.
 * 색은 sb.css 토큰만 (라이트 · 다크), 손가락 화면도 누르는 곳은 44px 이상. hidden 은 sb.css 의 [hidden] 이 늘 이긴다. 항목 목차는 스크롤로 바뀔 때 다시 칠하지 않게 전환 · 굵기 변화 없음. */

.ap-page {
  padding-bottom: clamp(24px, 4vw, 48px);
}
.ap-head {
  display: grid;
  justify-items: start;
  gap: 12px;
  padding-block: clamp(10px, 2.4vw, 28px) clamp(20px, 3vw, 32px);
}
.ap-title {
  font-size: clamp(30px, 4.4vw, 52px);
  line-height: 1.12;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-wrap: balance;
}
.ap-lead {
  max-width: 56ch;
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.7;
  color: var(--ink-2);
}
.ap-meta {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.ap-noscript {
  margin-bottom: 16px;
  padding: 14px 18px;
  border-radius: var(--r-sm);
  background: var(--red-soft);
  color: var(--red-text);
  font-weight: 700;
}
.ap-noscript a {
  text-decoration: underline;
}

/* ---------- 틀 ---------- */
/* 좁은 화면은 블록 — 제출 막대(.ap-side)가 폼이 보이는 동안 화면 아래에 붙는다 (격자 칸 안에서는 sticky 가 움직일 자리가 없다) */
.ap-form {
  display: block;
}
@media (min-width: 1000px) {
  .ap-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    column-gap: clamp(24px, 3vw, 48px);
    align-items: start;
  }
  .ap-side {
    position: sticky;
    top: calc(var(--header-h) + 24px);
  }
  .ap-narrow {
    display: none;
  }
}
/* 폼이 끝나면 제자리로 — 사이트 바닥을 가리지 않는다 (예전 지원서와 같다) */
@media (max-width: 999px) {
  .ap-side {
    position: sticky;
    bottom: 0;
    z-index: 20;
    margin: var(--gap) calc(var(--gutter) * -1) 0;
    padding: 12px var(--gutter) calc(12px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    background: var(--bg);
  }
}
.ap-main {
  display: grid;
  gap: var(--gap);
  min-width: 0;
}
/* 스팸 함정 — 사람에게는 보이지 않는다 (칸은 비어 있어야 한다) */
.ap-hp {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.ap-required {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.ap-req {
  margin-left: 2px;
  font-style: normal;
  font-weight: 800;
  color: var(--red-text);
}
.ap-required .ap-req {
  margin: 0 2px 0 0;
}

/* 항목 묶음 */
.ap-fs {
  display: grid;
  gap: 22px;
  padding: clamp(22px, 3vw, 36px);
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  scroll-margin-top: calc(var(--header-h) + 16px);
}
.ap-fs__title {
  font-size: clamp(20px, 2vw, 24px);
  font-weight: 800;
  letter-spacing: -0.03em;
}
.ap-fs__title:focus {
  outline: none;
}
.ap-fs__title:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 4px;
}

/* ---------- 칸 ---------- */
.ap-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}
.ap-label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 4px 12px;
}
.ap-label {
  font-size: 15px;
  font-weight: 700;
}
.ap-opt,
.ap-limit {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}
.ap-input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 16px; /* 16px 미만이면 iOS 가 누를 때 화면을 확대한다 */
  transition: border-color var(--dur) var(--ease);
}
textarea.ap-input {
  min-height: 108px;
  padding: 13px 16px;
  line-height: 1.6;
  resize: vertical;
}
.ap-input--lg {
  min-height: 188px;
}
.ap-input::placeholder {
  color: var(--muted);
}
.ap-input:hover {
  border-color: var(--muted);
}
.ap-input:focus {
  outline: none;
  border-color: var(--ink);
}
.ap-input:focus-visible {
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
}
.ap-input[aria-invalid='true'] {
  border-color: var(--red-text);
}
.ap-hint {
  font-size: 13px;
  line-height: 1.55;
  color: var(--muted);
}
.ap-error {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
  color: var(--red-text);
}
.ap-error::before {
  content: '';
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5h.01'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ap-counter {
  justify-self: end;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ap-pair {
  display: grid;
  gap: 22px;
}
@media (min-width: 640px) {
  .ap-pair {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}

/* 유입 경로 — 기본 select 에 모양만 (목록은 운영체제 것: 휴대폰은 아래 시트 · 넓은 화면은 펼침 목록) */
.ap-select {
  position: relative;
  display: block;
}
.ap-select select {
  padding-right: 44px;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
}
.ap-select select:invalid {
  color: var(--muted);
}
.ap-select select option {
  color: var(--ink);
  background: var(--surface);
}
/* 사이트 선택 상자(site.js)가 얹히면 원래 칸의 화살표는 숨긴다 — 단추가 제 화살표를 그린다 */
.ap-select > .sel ~ svg {
  display: none;
}
/* 원래 칸의 화살표만 (사이트 선택 상자 안의 아이콘은 건드리지 않는다) */
.ap-select > svg {
  position: absolute;
  top: 50%;
  right: 16px;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  color: var(--muted);
  pointer-events: none;
}

/* 파일 첨부 줄 — 줄 전체가 파일 칸 (누르거나 끌어다 놓기) */
.ap-upload {
  position: relative;
}
.ap-upload input[type='file'] {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.ap-upload input[type='file']:disabled {
  cursor: not-allowed;
}
.ap-upload__face {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 0 18px;
  border-radius: 14px;
  border: 1.5px dashed var(--line-strong);
  background: var(--bg);
  transition:
    border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}
.ap-upload__face svg {
  flex: none;
  width: 20px;
  height: 20px;
  color: var(--muted);
}
.ap-upload__text {
  font-size: 15px;
  font-weight: 700;
}
.ap-upload__drop {
  margin-left: auto;
  font-size: 13px;
  color: var(--muted);
}
@media (max-width: 559px) {
  .ap-upload__drop {
    display: none;
  }
}
.ap-upload:hover .ap-upload__face {
  border-color: var(--muted);
  background: var(--surface-2);
}
.ap-upload input:focus-visible + .ap-upload__face {
  border-style: solid;
  border-color: var(--ink);
  outline: 2.5px solid var(--focus);
  outline-offset: 2px;
}
.ap-upload.is-dragover .ap-upload__face {
  border-style: solid;
  border-color: var(--red-text);
  background: var(--red-soft);
}
.ap-upload.is-dragover .ap-upload__face svg {
  color: var(--red-text);
}
.ap-upload.is-full .ap-upload__face,
.ap-upload.is-full:hover .ap-upload__face {
  border-style: solid;
  background: var(--surface-2);
  color: var(--muted);
}
.ap-field.has-error .ap-upload__face {
  border-color: var(--red-text);
}
/* 고른 파일 칩 (careers-apply.js 가 그린다) */
.ap-files {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.ap-files:empty {
  display: none;
}
.ap-file {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 4px 4px 4px 14px;
  border-radius: 12px;
  background: var(--surface-2);
  font-size: 14px;
}
.ap-file__name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}
.ap-file__size {
  flex: none;
  margin-left: auto;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.ap-file__remove {
  flex: none;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition:
    background-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}
.ap-file__remove::before {
  content: '';
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E") center / contain no-repeat;
}
.ap-file__remove:hover {
  background: var(--red-soft);
  color: var(--red-text);
}
@media (pointer: coarse) {
  .ap-file__remove {
    width: 44px;
    height: 44px;
  }
}
