/*
 * 상담 신청 모달 (inquiry-modal 플러그인)
 * 스킨 CSS 와 섞이지 않도록 모든 규칙을 .gim 접두어 안에 둔다.
 * 색상은 --gim-primary (관리자 지정색 → 스킨 기본색) 하나만 받아 쓴다.
 */
html.gim-lock { overflow: hidden; }

.gim {
  --gim-primary: #1e3a8a;
  --gim-ink: #0f172a;
  --gim-text: #334155;
  --gim-muted: #64748b;
  --gim-line: #dbe1ea;
  --gim-danger: #dc2626;
  --gim-radius: 18px;
}

/* ---- 떠 있는 버튼 ---- */
.gim .gim-fab {
  position: fixed;
  right: 16px;
  bottom: calc(var(--gim-offset-mobile, 72px) + env(safe-area-inset-bottom, 0px));
  z-index: 45;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--gim-primary);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  text-decoration: none;
  /* 흰 테두리: 버튼과 같은 색 배경(어두운 히어로 등) 위에서도 구분되도록 */
  box-shadow: 0 0 0 2px rgb(255 255 255 / 0.9), 0 12px 28px -8px rgb(15 23 42 / 0.45), 0 2px 6px rgb(15 23 42 / 0.15);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.gim .gim-fab:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 0 0 2px rgb(255 255 255 / 0.9), 0 16px 32px -8px rgb(15 23 42 / 0.5), 0 2px 6px rgb(15 23 42 / 0.15); }
.gim .gim-fab:focus-visible { outline: 3px solid color-mix(in srgb, var(--gim-primary) 45%, #fff); outline-offset: 3px; }
.gim .gim-fab-icon { width: 20px; height: 20px; flex: none; }
@media (min-width: 768px) {
  .gim .gim-fab { right: 24px; bottom: var(--gim-offset-desktop, 84px); padding: 15px 22px; font-size: 16px; }
  .gim .gim-fab--mobile { display: none; }
}
@media (max-width: 767.98px) {
  .gim .gim-fab--desktop { display: none; }
}
.gim .gim-fab--hidden { display: none; }

/* ---- 모달: 모바일은 아래에서 올라오는 시트, 넓은 화면은 가운데 창 ---- */
.gim .gim-dialog {
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  max-height: 92dvh;
  margin: auto 0 0;
  padding: 0;
  border: 0;
  border-radius: var(--gim-radius) var(--gim-radius) 0 0;
  background: #fff;
  color: var(--gim-ink);
  overflow: auto;
  overscroll-behavior: contain;
  box-shadow: 0 -10px 40px rgb(15 23 42 / 0.25);
}
.gim .gim-dialog::backdrop { background: rgb(15 23 42 / 0.55); }
.gim .gim-dialog[open] { animation: gim-sheet 0.22s ease-out; }
@media (min-width: 640px) {
  .gim .gim-dialog {
    width: min(520px, calc(100% - 32px));
    max-height: calc(100dvh - 48px);
    margin: auto;
    border-radius: var(--gim-radius);
    box-shadow: 0 24px 60px -12px rgb(15 23 42 / 0.45);
  }
  .gim .gim-dialog[open] { animation: gim-pop 0.18s ease-out; }
}
@keyframes gim-sheet { from { transform: translateY(24px); opacity: 0.6; } }
@keyframes gim-pop { from { transform: translateY(8px) scale(0.98); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .gim .gim-dialog[open] { animation: none; }
  .gim .gim-fab { transition: none; }
}

.gim .gim-panel { box-sizing: border-box; padding: 22px 20px calc(20px + env(safe-area-inset-bottom, 0px)); }
@media (min-width: 640px) { .gim .gim-panel { padding: 28px 28px 26px; } }

.gim .gim-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.gim .gim-title { margin: 0; color: var(--gim-ink); font-size: 21px; font-weight: 800; line-height: 1.3; letter-spacing: -0.02em; }
.gim .gim-intro { margin: 6px 0 0; color: var(--gim-muted); font-size: 14.5px; line-height: 1.55; }
.gim .gim-close {
  display: grid; place-items: center; flex: none;
  width: 40px; height: 40px; margin: -6px -8px 0 0; padding: 0;
  border: 0; border-radius: 10px; background: transparent; color: var(--gim-muted); cursor: pointer;
}
.gim .gim-close:hover { background: #f1f5f9; color: var(--gim-ink); }
.gim .gim-close svg { width: 22px; height: 22px; }

/* ---- 폼 ---- */
.gim .gim-form { display: grid; gap: 14px; margin: 0; }
.gim .gim-row { display: grid; gap: 14px; }
@media (min-width: 480px) { .gim .gim-row { grid-template-columns: 1fr 1fr; } }
.gim .gim-field { min-width: 0; }
.gim .gim-label { display: block; margin: 0 0 6px; color: var(--gim-ink); font-size: 14px; font-weight: 600; }
.gim .gim-label em { color: var(--gim-danger); font-style: normal; }
.gim .gim-input {
  box-sizing: border-box; display: block; width: 100%; height: 48px; margin: 0; padding: 0 14px;
  border: 1px solid var(--gim-line); border-radius: 10px; background: #fff;
  color: var(--gim-ink); font: inherit; font-size: 16px; /* 16px 미만이면 iOS 가 확대한다 */
  box-shadow: none; outline: none; appearance: auto;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.gim .gim-textarea { height: auto; min-height: 104px; padding: 12px 14px; line-height: 1.55; resize: vertical; }
.gim .gim-input:focus { border-color: var(--gim-primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--gim-primary) 18%, transparent); }
.gim .gim-input[aria-invalid="true"] { border-color: var(--gim-danger); }
.gim .gim-error { margin: 6px 0 0; color: var(--gim-danger); font-size: 13.5px; }
.gim .gim-error[hidden], .gim .gim-alert[hidden], .gim .gim-done[hidden], .gim .gim-form[hidden] { display: none; }

.gim .gim-check { display: flex; align-items: flex-start; gap: 10px; margin: 0; color: var(--gim-text); font-size: 14px; line-height: 1.5; cursor: pointer; }
.gim .gim-check input { flex: none; width: 18px; height: 18px; margin: 1px 0 0; accent-color: var(--gim-primary); }
.gim .gim-check a { color: var(--gim-primary); text-decoration: underline; text-underline-offset: 2px; }

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

.gim .gim-alert { margin: 0; padding: 12px 14px; border-radius: 10px; background: #fef2f2; color: #b91c1c; font-size: 14px; line-height: 1.5; }

.gim .gim-submit {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; height: 52px; margin: 4px 0 0; padding: 0 20px;
  border: 0; border-radius: 12px; background: var(--gim-primary); color: #fff;
  font: inherit; font-size: 16.5px; font-weight: 700; cursor: pointer;
  transition: filter 0.15s;
}
.gim .gim-submit:hover { filter: brightness(1.08); }
.gim .gim-submit:focus-visible { outline: 3px solid color-mix(in srgb, var(--gim-primary) 45%, #fff); outline-offset: 2px; }
.gim .gim-submit[disabled] { opacity: 0.65; cursor: progress; }

.gim .gim-tel { margin: 2px 0 0; color: var(--gim-muted); font-size: 14px; text-align: center; }
.gim .gim-tel a { color: var(--gim-ink); font-weight: 700; text-decoration: none; }

/* ---- 접수 완료 ---- */
.gim .gim-done { padding: 12px 0 4px; text-align: center; outline: none; }
.gim .gim-done-icon { display: block; width: 56px; height: 56px; margin: 0 auto; color: var(--gim-primary); }
.gim .gim-done-title { margin: 12px 0 6px; color: var(--gim-ink); font-size: 19px; font-weight: 800; }
.gim .gim-done-text { margin: 0 0 20px; color: var(--gim-muted); font-size: 15px; line-height: 1.55; }
