/* =========================================================
   코딩두잇 AI 학습상담 (openAi.jsp)
   공통 헤더·하단·색상 변수는 resources/main/style.css를 그대로 사용
   좌우 끝선은 헤더(.header-inner) 여백과 같은 값으로 맞춤
   ========================================================= */
.consult { --pl: 80px; --pr: 34px; --navy: #121a2f; background: linear-gradient(180deg, #f3f8fe 0, #fff 420px); padding-bottom: 80px; }
.consult .wrap { padding-left: var(--pl); padding-right: var(--pr); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.consult ol { list-style: none; }

/* ---------- 제목 ---------- */
.c-top { padding: 28px 0 30px; }
.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); }
.c-top h1 { margin-top: 26px; font-size: 38px; font-weight: 800; letter-spacing: -1.2px; color: var(--navy); }
.c-top p { margin-top: 10px; font-size: 18px; line-height: 1.6; color: #4b5563; }

/* ---------- 레이아웃: 시작 전에는 상담창만, 상담을 시작하면 오른쪽 정보 영역 ---------- */
.c-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; align-items: start; }
.c-layout .c-side { display: none; }
.c-layout.is-active { grid-template-columns: minmax(0, 1fr) 340px; }
.c-layout.is-active .c-side { display: grid; }

/* ---------- 상담창 ---------- */
.c-chat { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: 20px; box-shadow: 0 10px 30px rgba(30, 70, 140, .08); }
.c-chat-head { display: flex; align-items: center; gap: 12px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.c-avatar, .c-msg-ico { flex-shrink: 0; display: grid; place-items: center; border-radius: 50%; background: linear-gradient(145deg, #2a7bff, #0d5ae6); color: #fff; }
.c-avatar { width: 42px; height: 42px; }
.c-chat-title { display: flex; flex-direction: column; gap: 2px; }
.c-chat-title strong { font-size: 17px; font-weight: 800; color: var(--navy); }
.c-chat-title span { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--muted); }
.c-dot { width: 8px; height: 8px; border-radius: 50%; background: #14b87a; }
.c-reset { margin-left: auto; height: 38px; padding: 0 16px; border: 1px solid #dfe4ec; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: #374151; transition: .15s; }
.c-reset:hover { border-color: var(--blue); color: var(--blue); }

.c-log { display: flex; flex-direction: column; gap: 14px; min-height: 380px; padding: 26px 22px 18px; }
.c-msg { display: flex; align-items: flex-end; gap: 10px; max-width: 86%; }
.c-msg.me { align-self: flex-end; }
.c-msg.card { max-width: 100%; align-items: flex-start; }
.c-msg-ico { width: 32px; height: 32px; }
.c-msg-ico::before { content: "AI"; font-size: 11px; font-weight: 800; letter-spacing: .3px; }
.c-bubble { padding: 13px 17px; border-radius: 18px 18px 18px 6px; background: #f1f6fe; color: #1f2937; font-size: 16px; line-height: 1.6; word-break: keep-all; overflow-wrap: anywhere; }
.c-msg.me .c-bubble { border-radius: 18px 18px 6px 18px; background: var(--blue); color: #fff; }
.c-typing { display: flex; gap: 5px; padding: 17px 18px; }
.c-typing i { width: 7px; height: 7px; border-radius: 50%; background: #8fb6f5; animation: c-blink 1.2s infinite ease-in-out; }
.c-typing i:nth-child(2) { animation-delay: .15s; }
.c-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes c-blink { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .c-typing i { animation: none; opacity: .7; } }

.c-choices { display: flex; flex-wrap: wrap; gap: 8px; padding-left: 42px; }
.c-chip { min-height: 40px; padding: 8px 16px; border: 1px solid #cfe0fb; border-radius: 999px; background: #fff; color: var(--blue-ink); font-size: 15px; font-weight: 600; text-align: left; transition: .15s; }
.c-chip:hover, .c-chip:focus-visible { background: var(--blue); border-color: var(--blue); color: #fff; }

/* 카드(학습 방향·상담 접수) */
.c-card { flex: 1; max-width: 620px; padding: 22px 24px; border: 1px solid #d9e6fb; border-radius: 16px; background: #fff; box-shadow: 0 4px 14px rgba(30, 70, 140, .06); }
.c-card-tag { display: inline-block; padding: 4px 10px; border-radius: 6px; background: var(--blue-tint); color: var(--blue); font-size: 13px; font-weight: 700; }
.c-card h3 { margin-top: 12px; font-size: 19px; font-weight: 800; letter-spacing: -.4px; color: var(--navy); }
.c-card > p:not(.c-card-tag) { margin-top: 8px; font-size: 15.5px; line-height: 1.65; color: #374151; }
.c-card .c-note, .c-note { font-size: 13.5px; color: var(--muted); }
.c-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.c-btn { display: inline-flex; align-items: center; justify-content: center; height: 46px; padding: 0 22px; border-radius: 12px; background: var(--blue); color: #fff; font-size: 15.5px; font-weight: 700; transition: .15s; }
.c-btn:hover { background: var(--blue-d); }
.c-btn.ghost { background: #fff; border: 1px solid #cfd8e6; color: #1f2937; }
.c-btn.ghost:hover { border-color: var(--blue); color: var(--blue); }

.c-consent label { display: block; margin-top: 14px; font-size: 14.5px; font-weight: 600; color: #374151; }
.c-consent input[type=text], .c-consent input[type=email], .c-consent textarea {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px; border: 1px solid #d5dbe4; border-radius: 10px; background: #fff;
  font-size: 15.5px; font-weight: 400; outline: 0; resize: vertical;
}
.c-consent input:focus, .c-consent textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(17, 102, 240, .15); }
.c-consent .c-agree { display: flex; align-items: flex-start; gap: 8px; font-weight: 500; line-height: 1.55; }
.c-agree input { width: 18px; height: 18px; margin-top: 2px; flex-shrink: 0; accent-color: var(--blue); }
.c-agree a { color: var(--blue); text-decoration: underline; }
.c-err { min-height: 0; margin-top: 8px; font-size: 14px; font-weight: 600; color: #d93025; }
.c-err:empty { display: none; }

/* 멘토 카드 (실제 등록 정보만 표시) */
.c-mentors { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; padding-left: 42px; }
.c-mentor { display: flex; align-items: flex-start; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; box-shadow: 0 4px 14px rgba(30, 70, 140, .07); }
.c-mentor-photo { width: 72px; height: 72px; flex-shrink: 0; border-radius: 50%; overflow: hidden; background: #eef3fa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23b8c7de'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4.4 3.6-7 8-7s8 2.6 8 7z'/%3E%3C/svg%3E") center / 40px no-repeat; }
.c-mentor-photo img { width: 100%; height: 100%; object-fit: cover; object-position: top; }
.c-mentor-body { display: flex; flex-direction: column; flex: 1; min-width: 0; align-self: stretch; }
.c-mentor h3 { font-size: 18px; font-weight: 800; color: var(--navy); }
.c-mentor p { margin-top: 6px; font-size: 14.5px; line-height: 1.6; color: #4b5563; }
.c-mentor .c-mentor-field { color: var(--blue); font-weight: 600; }
.c-mentor-why { padding: 10px 12px; border-radius: 10px; background: #f5f9ff; }
.c-mentor-why b { color: var(--navy); }
.c-mentor .c-actions { margin-top: auto; padding-top: 14px; }
.c-mentor .c-btn { flex: 1 0 auto; height: 42px; padding: 0 12px; font-size: 14.5px; white-space: nowrap; }

/* 입력창 */
.c-input { position: relative; display: flex; align-items: flex-end; gap: 10px; margin: 0 22px; padding: 10px 10px 10px 18px; border: 1.5px solid #cfdcf0; border-radius: 16px; background: #fff; transition: .15s; }
.c-input:focus-within { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(17, 102, 240, .12); }
.c-input textarea { flex: 1; min-height: 28px; max-height: 140px; padding: 6px 0; border: 0; outline: 0; resize: none; font: inherit; font-size: 16px; line-height: 1.6; color: var(--ink); background: none; }
.c-input textarea::placeholder { color: #8a94a6; }
.c-send { width: 48px; height: 48px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(145deg, #2a7bff, #0d5ae6); color: #fff; transition: .15s; }
.c-send:hover { filter: brightness(1.08); }
.c-input.is-busy .c-send { opacity: .5; pointer-events: none; }
.c-hint { padding: 10px 22px 18px; font-size: 13px; color: var(--muted); }

/* ---------- 오른쪽 정보 ---------- */
.c-side { gap: 14px; position: sticky; top: 110px; }
.c-box { padding: 20px 22px; border: 1px solid var(--line); border-radius: 16px; background: #fff; }
.c-box h2 { font-size: 16px; font-weight: 800; color: var(--navy); margin-bottom: 14px; }
.c-steps { position: relative; display: grid; gap: 14px; }
.c-steps::before { content: ""; position: absolute; left: 15px; top: 14px; bottom: 14px; width: 2px; background: #e3ebf7; }
.c-steps li { position: relative; display: flex; align-items: center; gap: 12px; font-size: 15px; color: #9aa4b5; }
.c-steps b { width: 32px; height: 32px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; background: #fff; border: 2px solid #dbe4f2; font-size: 12.5px; font-weight: 800; color: #9aa4b5; }
.c-steps li.done { color: #374151; }
.c-steps li.done b { background: var(--blue-tint); border-color: var(--blue-tint); color: var(--blue); }
.c-steps li.now { color: var(--navy); font-weight: 700; }
.c-steps li.now b { background: var(--blue); border-color: var(--blue); color: #fff; box-shadow: 0 0 0 4px rgba(17, 102, 240, .15); }
.c-sum { display: grid; gap: 10px; }
.c-sum div { display: flex; justify-content: space-between; gap: 12px; font-size: 14.5px; }
.c-sum dt { color: var(--muted); }
.c-sum dd { font-weight: 700; color: var(--navy); text-align: right; }
.c-side-mentors { display: grid; gap: 8px; font-size: 14.5px; color: #374151; }
.c-side-mentors li { padding: 9px 12px; border-radius: 10px; background: #f5f9ff; }
.c-trust { padding: 0 6px; font-size: 13px; line-height: 1.65; color: var(--muted); }

.c-steps-mini { display: none; }

/* ---------- 반응형 ---------- */
@media (max-width: 1240px) { .consult { --pl: 32px; --pr: 24px; } .c-layout.is-active { grid-template-columns: minmax(0, 1fr) 300px; } }
@media (max-width: 1100px) { .consult { --pl: 20px; --pr: 20px; } }
@media (max-width: 960px) {
  .consult { --pl: 16px; --pr: 16px; }
  .c-layout.is-active { grid-template-columns: minmax(0, 1fr); }
  .c-layout.is-active .c-side { display: none; }
  .c-steps-mini { display: flex; gap: 4px; padding: 12px 16px 0; font-size: 12px; color: #9aa4b5; }
  .c-steps-mini li { flex: 1; padding-top: 8px; border-top: 3px solid #e3ebf7; text-align: center; white-space: nowrap; }
  .c-steps-mini li.done { border-color: #a9c8fa; color: #4b5563; }
  .c-steps-mini li.now { border-color: var(--blue); color: var(--blue); font-weight: 700; }
}
@media (max-width: 760px) {
  .consult { padding-bottom: 40px; }
  .c-top { padding: 18px 0 20px; }
  .crumb { font-size: 13.5px; }
  .c-top h1 { margin-top: 16px; font-size: 26px; }
  .c-top p { font-size: 15px; }
  .c-chat { border-radius: 16px; }
  .c-chat-head { padding: 12px 14px; gap: 10px; }
  .c-avatar { width: 36px; height: 36px; }
  .c-chat-title strong { font-size: 15px; }
  .c-chat-title span { font-size: 12.5px; }
  .c-reset { height: 34px; padding: 0 10px; font-size: 13px; }
  .c-log { min-height: 320px; padding: 18px 14px 14px; gap: 12px; }
  .c-msg { max-width: 94%; }
  .c-msg-ico { width: 28px; height: 28px; }
  .c-bubble { padding: 11px 14px; font-size: 15px; }
  .c-choices { padding-left: 0; }
  .c-chip { min-height: 38px; padding: 7px 13px; font-size: 14px; }
  .c-msg.card .c-msg-ico { display: none; }
  .c-card { padding: 18px 16px; }
  .c-card h3 { font-size: 17px; }
  .c-btn { flex: 1; height: 44px; padding: 0 14px; font-size: 15px; }
  .c-mentors { grid-template-columns: 1fr; padding-left: 0; }
  /* 입력창은 화면 아래에 붙여 언제든 입력 가능 */
  .c-input { position: sticky; bottom: 10px; z-index: 5; margin: 0 10px; padding-left: 14px; box-shadow: 0 6px 20px rgba(30, 70, 140, .12); }
  .c-input textarea { font-size: 16px; }
  .c-send { width: 42px; height: 42px; }
  .c-hint { padding: 8px 14px 14px; font-size: 12px; }
}

/* 추천 멘토 아래: 전체 멘토 문의 링크 */
.c-all-link { display: block; margin-top: 12px; font-size: 14.5px; font-weight: 700; color: var(--blue); text-align: center; }
.c-all-link:hover { color: var(--blue-d); }
@media (max-width: 760px) { .c-mentor .c-btn { padding: 0 8px; font-size: 13px; } }

/* 이름·이메일 칸 위 조건 요약: 학습 요약이 숨겨지는 좁은 화면에서만 */
.c-consent .c-consent-sum { display: none; }
@media (max-width: 960px) {
  .c-consent .c-consent-sum { display: block; padding: 10px 12px; border-radius: 10px; background: #f5f9ff; font-size: 14px; font-weight: 600; line-height: 1.55; color: var(--navy, #121a2f); overflow-wrap: anywhere; }
}
