/* ============================================================================
   forms.css — 수강 문의폼 + AI 상담 챗봇
   기존 base.css / style.css 는 건드리지 않고 여기에만 추가합니다.
   색·간격·모션은 기존 디자인 토큰을 그대로 씁니다.
   ========================================================================== */

/* ══════════════════════════ 수강 문의폼 ══════════════════════════ */

.iq { display: grid; gap: clamp(20px, 2.4vw, 26px); }

.iq__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.iq__row { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(14px, 1.8vw, 20px); }
@media (max-width: 620px) { .iq__row { grid-template-columns: 1fr; } }

.iq__f { display: grid; gap: 10px; }
.iq__set { border: 0; padding: 0; margin: 0; }

.iq__l {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
  padding: 0;
}
.iq__l span { color: var(--rose-500); }

.iq__i {
  width: 100%;
  min-height: 52px;
  padding: 14px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-family: inherit;
  font-size: 15px;
  color: var(--ink);
  transition: border-color .28s var(--ease), box-shadow .28s var(--ease);
}
.iq__i::placeholder { color: var(--faint); }
.iq__i:focus {
  outline: none;
  border-color: var(--rose-300);
  box-shadow: 0 0 0 3px var(--rose-50);
}
.iq__ta { resize: vertical; min-height: 120px; line-height: 1.75; }

/* 선택 칩 — 배우고 싶은 과정 · 희망 연락 방법 */
.iq__chips { display: flex; flex-wrap: wrap; gap: 8px; }

.iq__chip { position: relative; display: inline-flex; }
.iq__chip input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; cursor: pointer; margin: 0;
}
.iq__chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  transition: background-color .28s var(--ease), border-color .28s var(--ease), color .28s var(--ease);
}
.iq__chip input:checked + span {
  background: var(--rose-50);
  border-color: var(--rose-300);
  color: var(--rose-700);
  font-weight: 600;
}
.iq__chip input:focus-visible + span { outline: 2px solid var(--rose-500); outline-offset: 2px; }
@media (hover: hover) { .iq__chip:hover span { border-color: var(--rose-200); } }

/* 개인정보 수집·이용 동의 */
.iq__privacy {
  padding: clamp(20px, 2.4vw, 26px);
  background: var(--ivory-deep);
  border: 1px solid var(--line-soft);
  border-radius: 6px;
}

.iq__agree {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  min-height: 48px;
  cursor: pointer;
  font-size: 14.5px;
  line-height: 1.6;
  color: var(--ink);
}
.iq__agree input {
  width: 20px; height: 20px; margin: 2px 0 0; flex: none;
  accent-color: var(--rose-500); cursor: pointer;
}
.iq__agree b { font-weight: 600; }
.iq__agree em { font-style: normal; color: var(--rose-500); font-size: 13px; }

.iq__terms { margin-top: 16px; display: grid; gap: 7px; }
.iq__terms > div { display: grid; grid-template-columns: 78px 1fr; gap: 10px; }
.iq__terms dt { font-size: 12.5px; color: var(--muted); }
.iq__terms dd { margin: 0; font-size: 12.5px; color: var(--ink-soft); line-height: 1.7; }
@media (max-width: 480px) {
  .iq__terms > div { grid-template-columns: 1fr; gap: 2px; }
}

.iq__note { margin-top: 14px; font-size: 12.5px; color: var(--muted); line-height: 1.7; }

.iq__msg {
  padding: 14px 16px;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.7;
}
.iq__msg.is-ok    { background: var(--rose-50); border: 1px solid var(--rose-200); color: var(--rose-700); }
.iq__msg.is-error { background: #FDF1EC; border: 1px solid #F0C9BB; color: #9A4A2E; }

.iq__submit { width: 100%; }
.iq__submit:disabled { opacity: .55; cursor: not-allowed; }


/* ══════════════════════════ AI 상담 챗봇 ══════════════════════════ */

.cbot { position: fixed; right: 20px; bottom: 20px; z-index: 70; }

.cbot__fab {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 52px;
  padding: 0 20px;
  border: 1px solid var(--rose-200);
  border-radius: 999px;
  background: var(--surface);
  color: var(--rose-700);
  font-family: inherit;
  font-size: 14.5px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(74, 58, 48, .05), 0 12px 28px -16px rgba(141, 93, 83, .45);
  transition: transform .28s var(--ease), box-shadow .28s var(--ease);
}
@media (hover: hover) {
  .cbot__fab:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(74,58,48,.06), 0 18px 34px -18px rgba(141,93,83,.5);
  }
}
.cbot__fab:focus-visible { outline: 2px solid var(--rose-500); outline-offset: 3px; }
.cbot.is-open .cbot__fab { display: none; }

.cbot__panel {
  width: min(380px, calc(100vw - 32px));
  height: min(560px, calc(100vh - 110px));
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(74, 58, 48, .08), 0 34px 70px -28px rgba(74, 58, 48, .34);
  animation: cbotIn .3s var(--ease);
}
@keyframes cbotIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }

.cbot__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 14px 20px;
  border-bottom: 1px solid var(--line-soft);
  background: var(--ivory-deep);
}
.cbot__t { font-size: 15px; font-weight: 600; color: var(--ink); letter-spacing: -0.015em; }
.cbot__s { margin-top: 4px; font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.cbot__x {
  flex: none; width: 36px; height: 36px; border: 0; background: transparent;
  font-size: 22px; line-height: 1; color: var(--muted); cursor: pointer; border-radius: 50%;
  transition: background-color .25s var(--ease), color .25s var(--ease);
}
.cbot__x:hover { background: var(--cream); color: var(--ink); }

.cbot__log {
  flex: 1;
  overflow-y: auto;
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--ivory);
}

.cbot__m {
  max-width: 84%;
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
  word-break: break-word;
}
.cbot__m--user {
  align-self: flex-end;
  background: var(--rose-500);
  color: #FFF9F6;
  border-bottom-right-radius: 4px;
}
.cbot__m--assistant {
  align-self: flex-start;
  background: var(--surface);
  border: 1px solid var(--line-soft);
  color: var(--ink);
  border-bottom-left-radius: 4px;
}
.cbot__m.is-notice { background: var(--rose-50); border-color: var(--rose-100); color: var(--rose-700); }

.cbot__typing { display: inline-flex; gap: 5px; align-items: center; padding: 15px 14px; }
.cbot__typing i {
  width: 6px; height: 6px; border-radius: 50%; background: var(--rose-300);
  animation: cbotDot 1.3s ease-in-out infinite;
}
.cbot__typing i:nth-child(2) { animation-delay: .18s; }
.cbot__typing i:nth-child(3) { animation-delay: .36s; }
@keyframes cbotDot { 0%, 60%, 100% { opacity: .3; } 30% { opacity: 1; } }

.cbot__form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--line-soft);
  background: var(--surface);
}
.cbot__in {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--ivory);
}
.cbot__in:focus { outline: none; border-color: var(--rose-300); box-shadow: 0 0 0 3px var(--rose-50); }
.cbot__send {
  flex: none;
  width: 48px; height: 48px;
  border: 0; border-radius: 50%;
  background: var(--rose-700);
  color: #FFF9F6;
  cursor: pointer;
  display: grid; place-items: center;
  transition: background-color .25s var(--ease);
}
.cbot__send:hover { background: var(--rose-500); }
.cbot__send:focus-visible { outline: 2px solid var(--rose-500); outline-offset: 3px; }

/* 모바일 — 하단 고정 CTA(.fab) 와 겹치지 않게 위로 올립니다 */
@media (max-width: 960px) {
  .cbot { right: 14px; bottom: calc(78px + env(safe-area-inset-bottom)); }
  .cbot__panel { height: min(70vh, calc(100vh - 180px)); }
}

@media (prefers-reduced-motion: reduce) {
  .cbot__panel { animation: none; }
  .cbot__fab { transition: none; }
  .cbot__typing i { animation: none; opacity: .6; }
}
