/* =========================================================
   코딩두잇 레슨 신청 (WEB-INF/apply/applyJoin.jsp)
   공통 헤더·하단·색상 변수는 resources/main/style.css를 그대로 사용
   좌우 끝선은 헤더(.header-inner) 여백과 같은 값으로 맞춤
   ========================================================= */
.apply { --pl: 80px; --pr: 34px; --navy: #121a2f; background: linear-gradient(180deg, #f3f8fe 0, #fff 380px); padding-bottom: 80px; }
.apply .wrap { padding-left: var(--pl); padding-right: var(--pr); }
.apply ol { list-style: none; }

/* ---------- 제목·단계 ---------- */
.a-top { padding: 28px 0 26px; }
.crumb { display: flex; align-items: center; gap: 10px; font-size: 15px; color: #4b5563; }
.crumb a { display: grid; place-items: center; color: #1f2937; }
.crumb a:hover { color: var(--blue); }
.a-top h1 { margin-top: 26px; font-size: 38px; font-weight: 800; letter-spacing: -1.2px; color: var(--navy); }
.a-top p { margin-top: 10px; font-size: 17px; line-height: 1.6; color: #4b5563; }
.a-steps { display: flex; gap: 10px; margin-top: 24px; }
.a-steps li { flex: 1; display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: #fff; border: 1px solid var(--line); font-size: 15px; font-weight: 600; color: #9aa4b5; transition: .2s; }
.a-steps b { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; border: 2px solid #dbe4f2; font-size: 13px; }
.a-steps li.done { color: #374151; }
.a-steps li.done b { background: var(--blue-tint); border-color: var(--blue-tint); color: var(--blue); }
.a-steps li.now { border-color: var(--blue); color: var(--navy); box-shadow: 0 4px 14px rgba(17, 102, 240, .12); }
.a-steps li.now b { background: var(--blue); border-color: var(--blue); color: #fff; }

/* ---------- 레이아웃: 왼쪽 입력, 오른쪽 멘토 ---------- */
.a-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; align-items: start; }
.a-form { display: grid; gap: 18px; grid-column: 1; grid-row: 1; }
.a-mentor { grid-column: 2; grid-row: 1; position: sticky; top: 110px; border: 1px solid var(--line); border-radius: 20px; background: #fff; overflow: hidden; box-shadow: 0 10px 30px rgba(30, 70, 140, .08); }

/* 멘토 카드 (실제 등록 정보만) */
.a-gallery { display: grid; background: #eef3fa; }
.a-gallery img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: top; }
.a-gallery.multi { grid-template-columns: repeat(4, 1fr); gap: 6px; padding-bottom: 6px; }
.a-gallery.multi img { aspect-ratio: 1; border-radius: 8px; cursor: pointer; opacity: .65; transition: .15s; }
.a-gallery.multi img:first-child { margin-left: 6px; }
.a-gallery.multi img.on { grid-column: 1 / -1; grid-row: 1; aspect-ratio: 4 / 3; border-radius: 0; margin: 0; opacity: 1; cursor: default; }
.a-gallery.multi img:not(.on):hover, .a-gallery.multi img:focus-visible { opacity: 1; outline: 2px solid var(--blue); }
.a-mentor-body { padding: 20px 22px 22px; }
.a-course { display: inline-block; padding: 4px 10px; border-radius: 6px; background: var(--blue-tint); color: var(--blue); font-size: 13.5px; font-weight: 700; }
.a-mentor h2 { margin-top: 10px; font-size: 24px; font-weight: 800; letter-spacing: -.6px; color: var(--navy); }
.a-mentor h2 span { font-size: 17px; font-weight: 600; color: #4b5563; }
.a-intro { margin-top: 8px; font-size: 15px; line-height: 1.65; color: #4b5563; white-space: pre-line; max-height: 9.9em; overflow: auto; }
.a-pay { display: flex; justify-content: space-between; align-items: center; margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #f5f9ff; font-size: 15px; }
.a-pay dt { color: var(--muted); }
.a-pay dd { font-weight: 800; color: var(--navy); }
.a-links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.a-links a { display: grid; place-items: center; height: 42px; border: 1px solid #d5dbe4; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: #374151; transition: .15s; }
.a-links a:hover { border-color: var(--blue); color: var(--blue); }
.a-state { margin-top: 14px; padding: 12px 14px; border-radius: 12px; background: #fff4e5; color: #9a5b00; font-size: 14.5px; font-weight: 600; }

/* ---------- 입력 카드 ---------- */
.a-card { padding: 26px 28px; border: 1px solid var(--line); border-radius: 20px; background: #fff; box-shadow: 0 4px 16px rgba(30, 70, 140, .05); }
.a-card > h2 { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 800; color: var(--navy); }
.a-card > h2 b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--blue); color: #fff; font-size: 13px; }
.a-field { margin-top: 22px; }
.a-label { display: block; margin-bottom: 10px; font-size: 15.5px; font-weight: 700; color: #1f2937; }
.a-label em { margin-left: 6px; font-style: normal; font-size: 12.5px; font-weight: 700; color: var(--blue); }
.a-help { margin-top: 8px; font-size: 13.5px; line-height: 1.55; color: var(--muted); }
.a-row .a-help { margin-top: 0; }
.a-note { margin-top: 12px; padding: 10px 14px; border-radius: 10px; background: #eef9f3; color: #1e8758; font-size: 14px; font-weight: 600; }
.a-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.a-between { justify-content: space-between; margin-top: 8px; }
.a-count { font-size: 13px; color: var(--muted); }
.a-area { margin-top: 10px; }
.a-area[hidden] { display: none; }

/* 선택 버튼(라디오를 칩 모양으로) */
.a-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.a-chips label { position: relative; cursor: pointer; }
.a-chips input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.a-chips span { display: inline-flex; align-items: center; min-height: 42px; padding: 8px 16px; border: 1px solid #d5dbe4; border-radius: 999px; background: #fff; font-size: 15px; font-weight: 600; color: #374151; transition: .15s; }
.a-chips label:hover span { border-color: var(--blue); color: var(--blue); }
.a-chips input:checked + span { background: var(--blue); border-color: var(--blue); color: #fff; }
.a-chips input:focus-visible + span { box-shadow: 0 0 0 3px rgba(17, 102, 240, .3); }

.a-select, .a-input, .a-card textarea {
  height: 46px; padding: 0 14px; border: 1px solid #d5dbe4; border-radius: 10px; background: #fff; font: inherit; font-size: 15.5px; color: var(--ink); outline: 0; transition: .15s;
}
.a-select { min-width: 180px; padding-right: 36px; appearance: none; -webkit-appearance: none;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") right 12px center / 18px no-repeat; }
.a-select:disabled { background-color: #f3f4f6; }
.a-input { width: min(100%, 320px); }
.a-card textarea { display: block; width: 100%; height: auto; min-height: 150px; padding: 12px 14px; line-height: 1.65; resize: vertical; }
.a-select:focus, .a-input:focus, .a-card textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(17, 102, 240, .15); }
.a-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.a-quick button { height: 32px; padding: 0 12px; border-radius: 8px; background: #f1f6fe; color: var(--blue-ink); font-size: 13.5px; font-weight: 600; }
.a-quick button:hover { background: var(--blue-tint); }

.a-checks { display: grid; gap: 10px; }
.a-checks.a-inline { display: flex; flex-wrap: wrap; gap: 10px 22px; }
.a-checks label { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.5; color: #4b5563; cursor: pointer; }
.a-checks b { margin-right: 6px; color: #1f2937; }
.a-checks input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--blue); }

.a-err { margin-top: 8px; font-size: 14px; font-weight: 600; color: #d93025; }
.a-err:empty { display: none; }
.has-err .a-chips span, .has-err .a-select, .has-err .a-input, .has-err textarea { border-color: #f1a7a1; }
.a-privacy { margin-top: 22px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 13.5px; line-height: 1.6; color: var(--muted); }
.a-privacy a { color: var(--blue); text-decoration: underline; }

/* 확인 */
.a-sum { display: grid; gap: 10px; margin-top: 16px; }
.a-sum div { display: flex; justify-content: space-between; gap: 16px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); font-size: 15px; }
.a-sum div:last-child { border-bottom: 0; }
.a-sum dt { flex-shrink: 0; color: var(--muted); }
.a-sum dd { font-weight: 700; color: var(--navy); text-align: right; }
.a-submit { display: flex; gap: 10px; margin-top: 20px; }
.a-btn { flex: 2; height: 56px; border-radius: 14px; background: var(--blue); color: #fff; font-size: 18px; font-weight: 700; transition: .15s; }
.a-btn:hover { background: var(--blue-d); }
.a-btn:disabled { background: #9db9e8; cursor: default; }
.a-btn.ghost { flex: 1; background: #fff; border: 1px solid #cfd8e6; color: #374151; }
.a-btn.ghost:hover { border-color: var(--blue); color: var(--blue); }

/* 확인 창 */
.a-modal { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 16px; background: rgba(17, 24, 39, .45); }
.a-modal[hidden] { display: none; }
.a-modal-box { width: min(100%, 460px); padding: 28px; border-radius: 20px; background: #fff; box-shadow: 0 20px 50px rgba(0, 0, 0, .2); }
.a-modal-box h2 { font-size: 21px; font-weight: 800; color: var(--navy); }

/* ---------- 반응형 ---------- */
@media (max-width: 1240px) { .apply { --pl: 32px; --pr: 24px; } .a-layout { grid-template-columns: minmax(0, 1fr) 320px; } }
@media (max-width: 1100px) { .apply { --pl: 20px; --pr: 20px; } }
@media (max-width: 960px) {
  .apply { --pl: 16px; --pr: 16px; }
  .a-layout { grid-template-columns: minmax(0, 1fr); }
  .a-mentor { grid-column: 1; grid-row: 1; position: static; display: grid; grid-template-columns: 200px 1fr; }
  .a-form { grid-row: 2; }
}
@media (max-width: 760px) {
  .apply { padding-bottom: 96px; }
  .a-top { padding: 18px 0 18px; }
  .crumb { font-size: 13.5px; }
  .a-top h1 { margin-top: 16px; font-size: 26px; }
  .a-top p { font-size: 14.5px; }
  .a-steps { gap: 4px; margin-top: 16px; }
  .a-steps li { flex-direction: column; gap: 4px; padding: 8px 2px; font-size: 11.5px; text-align: center; border-radius: 10px; }
  .a-steps b { width: 24px; height: 24px; font-size: 12px; }
  .a-mentor { grid-template-columns: 1fr; border-radius: 16px; }
  .a-gallery img, .a-gallery.multi img.on { aspect-ratio: 16 / 10; }
  .a-mentor-body { padding: 16px; }
  .a-mentor h2 { font-size: 21px; }
  .a-card { padding: 20px 16px; border-radius: 16px; }
  .a-card > h2 { font-size: 18px; }
  .a-chips span { min-height: 40px; padding: 7px 13px; font-size: 14px; }
  .a-select { width: 100%; }
  .a-input { width: 100%; }
  /* 신청 버튼은 화면 아래에 고정 */
  .a-confirm .a-submit { position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; margin: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: #fff; box-shadow: 0 -6px 20px rgba(30, 70, 140, .12); }
  .a-btn { height: 50px; font-size: 16.5px; }
  .a-modal-box { padding: 22px 18px; }
}

/* 멘토 사진: 메인 멘토 목록(.photo)과 같은 크기·비율 (1333px 기준 224px, 760px 이하 200px) */
.a-gallery, .a-gallery.multi { width: 224px; margin: 20px auto 0; padding-bottom: 0; background: transparent; }
.a-gallery img, .a-gallery.multi img.on { aspect-ratio: 150 / 160; border-radius: 10px; object-fit: cover; object-position: top; }
.a-gallery.multi img:first-child { margin-left: 0; }
@media (max-width: 1100px) { .a-gallery, .a-gallery.multi { width: 220px; } }
@media (max-width: 960px) { .a-mentor { grid-template-columns: 260px 1fr; align-items: start; } }
@media (max-width: 760px) {
  .a-mentor { grid-template-columns: 1fr; }
  .a-gallery, .a-gallery.multi { width: 200px; }
  .a-gallery img, .a-gallery.multi img.on { aspect-ratio: 150 / 160; }
}

/* 공통 환불 정책 안내 */
.a-policy { margin-top: 10px; padding: 10px 12px; border-radius: 10px; background: #f5f9ff; font-size: 13.5px; line-height: 1.55; color: #4b5563; word-break: keep-all; }
.a-policy a { color: var(--blue); font-weight: 700; text-decoration: underline; white-space: nowrap; }

/* 멘토가 쓴 연락처·환불 안내 모자이크 */
.a-intro mark { display: inline-block; max-width: 100%; overflow: hidden; white-space: nowrap; vertical-align: bottom; padding: 0 2px; border-radius: 3px; color: transparent; background: repeating-conic-gradient(#cbd5e1 0 25%, #e5e7eb 0 50%) 0 0 / 8px 8px; user-select: none; -webkit-box-decoration-break: clone; box-decoration-break: clone; }

/* 문의 내용 연락처 확인 창 */
.a-cw-text { margin-top: 12px; font-size: 16px; line-height: 1.65; color: #374151; word-break: keep-all; }
.a-modal-act { display: flex; gap: 10px; margin-top: 20px; }

/* 휴대폰 번호 삭제 안내 */
.a-phone-note { margin-top: 8px; padding: 10px 12px; border: 1px solid #fed7aa; border-radius: 10px; background: #fff7ed; color: #9a3412; font-size: 14.5px; font-weight: 600; line-height: 1.55; word-break: keep-all; }
.a-phone-note:empty { display: none; }
