/*
  ASK (문의하기) PAGE
  biz-place.kr/ask 의 마크업 구조·박스 모델·rem 단위 체계를 그대로 재현.
  실제 아이콘/사진 에셋이 없는 부분은 프로젝트 브랜드 그라디언트로 대체.
*/

.ask-main {
  position: relative;
  margin: 0 auto;
  width: 127.2rem;
  max-width: 100%;
}

.hp-field {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.ask-main::before {
  content: "";
  display: block;
  width: 100%;
  height: 15rem;
  background-color: transparent;
}

.ask-main article {
  position: relative;
  display: flex;
  width: 100%;
}

/* ---------- BANNER ---------- */
article.ask-banner {
  flex-wrap: wrap;
  justify-content: flex-start;
  align-content: center;
  padding: 0 0 0 10.8rem;
  height: 28.8rem;
  background-image: url('../img/ask-hero-bg.jpg');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

article.ask-banner h1 {
  width: 100%;
  font-size: 2.9rem;
  font-weight: 500;
  color: #fff;
  line-height: 2.9rem;
}

article.ask-banner h2 {
  margin: 3rem 0 0 0;
  max-width: 60rem;
  font-size: 1.9rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.85);
  line-height: 2.6rem;
}

/* ---------- TITLE ---------- */
article.ask-title {
  justify-content: center;
  align-items: center;
  margin: 13rem 0 0 0;
  height: 15rem;
  font-size: 4rem;
  font-weight: 700;
  color: var(--color-text);
  border-bottom: 1px solid var(--color-border);
}

/* ---------- FORM ALERT ---------- */
.form-alert {
  position: fixed;
  left: 50%;
  top: 2rem;
  transform: translate(-50%, -8rem);
  padding: 1.4rem 2.8rem;
  max-width: 90vw;
  font-size: 1.4rem;
  font-weight: 700;
  color: #fff;
  background: rgba(30, 30, 30, 0.95);
  border-radius: 3rem;
  box-shadow: 0 1rem 2.4rem rgba(0, 0, 0, 0.2);
  z-index: 400;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}

.form-alert.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

/* ---------- CATEGORY ---------- */
article.ask-ctg {
  flex-wrap: wrap;
  align-content: center;
  height: 45rem;
  ㅡ: 0 3rem;
  box-sizing: border-box;
}

article.ask-ctg::after {
  content: "";
  position: absolute;
  left: 3rem;
  bottom: 0;
  width: calc(100% - 6rem);
  height: 1px;
  background-color: var(--color-sub);
}

article.ask-ctg h2 {
  padding: 0 2.5rem;
  width: 100%;
  font-size: 2.3rem;
  font-weight: 600;
  color: var(--color-primary);
  line-height: 2.3rem;
}

article.ask-ctg div.container {
  width: 100%;
}

article.ask-ctg input[type="radio"] {
  display: none;
}

article.ask-ctg div.container div.wrapper {
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  margin: 5rem 0 0 0;
  width: 100%;
}

article.ask-ctg div.container div.wrapper label {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 16rem;
  height: 26.6rem;
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--color-text);
  text-align: center;
  background: no-repeat 50% 5rem / 7rem 7rem;
  cursor: pointer;
}

article.ask-ctg div.container div.wrapper label::before {
  content: "";
  position: absolute;
  left: calc((100% - 2rem) / 2);
  top: 0;
  width: 2rem;
  height: 2rem;
  background-color: #fff;
  box-sizing: border-box;
  border: 2px solid var(--color-text);
  border-radius: 0.5rem;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

article.ask-ctg div.container div.wrapper label.single  { background-image: url('../img/ask-ctg-single-icon.png');  background-size: contain; }
article.ask-ctg div.container div.wrapper label.package { background-image: url('../img/ask-ctg-package-icon.png'); background-size: contain; }
article.ask-ctg div.container div.wrapper label.edu     { background-image: url('../img/ask-ctg-edu-icon.png');     background-size: contain; }
article.ask-ctg div.container div.wrapper label.etc     { background-image: url('../img/ask-ctg-etc-icon.png');     background-size: contain; }

article.ask-ctg div.container div.wrapper input[type="radio"]:checked + label::before {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

/* ---------- FORM (텍스트 입력) ---------- */
article.ask-form {
  flex-wrap: wrap;
  justify-content: space-between;
  align-content: flex-start;
  padding: 0 3rem;
  box-sizing: border-box;
}

article.ask-form section {
  position: relative;
  padding: 0 2.5rem 0 21.6rem;
  width: 50%;
  height: 12rem;
  border-bottom: 1px solid var(--color-sub);
}

article.ask-form section::before {
  content: attr(data-title);
  position: absolute;
  display: flex;
  align-items: center;
  left: 2.5rem;
  top: 0;
  width: max-content;
  height: 100%;
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-text);
}

article.ask-form section input[type="text"] {
  width: 100%;
  height: 100%;
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--color-text);
  font-family: inherit;
  border: none;
  background: none;
  outline: none;
}

article.ask-form section input[type="text"]::placeholder {
  color: var(--color-sub);
}

article.ask-form section.invalid {
  border-bottom-color: var(--color-primary);
}

article.ask-form section.invalid::before {
  color: var(--color-primary);
}

/* ---------- MSG (문의내용/동의/제출) ---------- */
article.ask-msg {
  flex-wrap: wrap;
  justify-content: space-between;
  align-content: flex-start;
  padding: 6rem 3rem 20rem;
  box-sizing: border-box;
}

article.ask-msg h3 {
  padding: 0 2.5rem;
  width: 100%;
  font-size: 2rem;
  font-weight: 600;
  color: var(--color-text);
  line-height: 2rem;
}

article.ask-msg textarea {
  margin: 3rem 2.5rem 0;
  padding: 2.5rem;
  width: calc(100% - 5rem);
  height: 42rem;
  background-color: var(--color-bg-soft);
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--color-text);
  font-family: inherit;
  border: none;
  outline: none;
}

article.ask-msg textarea.invalid {
  box-shadow: inset 0 0 0 2px var(--color-primary);
}

article.ask-msg .msg-count {
  margin: 0.8rem 2.5rem 0 0;
  width: calc(100% - 5rem);
  font-size: 1.2rem;
  color: var(--color-sub);
  text-align: right;
}

article.ask-msg div.agree {
  margin: 3rem 2.5rem 0;
  padding: 2rem;
  width: calc(100% - 5rem);
  height: auto;
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--color-sub);
  line-height: 2rem;
  border: 1px solid var(--color-border);
}

article.ask-msg div.agree ul {
  margin: 0 0 1rem 3rem;
  list-style-type: disc;
}

article.ask-msg div.agree ul:last-of-type {
  margin: 0 0 0 3rem;
}

article.ask-msg input[type="checkbox"] {
  display: none;
}

article.ask-msg label[for="agree"] {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 0 0 3rem;
  width: max-content;
  height: 3.4rem;
  font-size: 1.4rem;
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  margin: 1rem 2.5rem 0;
}

article.ask-msg label[for="agree"]::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  width: 2.3rem;
  height: 2.3rem;
  transform: translateY(-50%);
  box-sizing: border-box;
  border: 2px solid var(--color-border);
  border-radius: 0.5rem;
  background-color: #fff;
  transition: background-color 0.3s ease, border-color 0.3s ease;
}

article.ask-msg label[for="agree"]::after {
  content: "";
  position: absolute;
  left: 0.7rem;
  top: 1.55rem;
  width: 0.9rem;
  height: 0.5rem;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: translateY(-60%) rotate(-45deg);
  opacity: 0;
  transition: opacity 0.3s ease;
}

article.ask-msg input[type="checkbox"]:checked + label[for="agree"]::before {
  background-color: var(--color-primary);
  border-color: var(--color-primary);
}

article.ask-msg input[type="checkbox"]:checked + label[for="agree"]::after {
  opacity: 1;
}

article.ask-msg button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 4rem 2.5rem 0;
  padding: 0 3rem;
  width: 26rem;
  height: 5.8rem;
  font-size: 1.7rem;
  font-weight: 800;
  color: #fff;
  background: var(--gradient);
  border-radius: 2.9rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1rem 2.4rem rgba(255, 0, 0, 0.22);
}

article.ask-msg button::after {
  content: "\2192";
  font-size: 2.2rem;
}

article.ask-msg button:hover {
  transform: translateY(-2px);
}

article.ask-msg button:disabled {
  opacity: 0.65;
  cursor: default;
  transform: none;
}

article.ask-msg button.loading::after {
  content: "";
  width: 1.8rem;
  height: 1.8rem;
  border: 3px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: ask-spin 0.7s linear infinite;
}

@keyframes ask-spin {
  to { transform: rotate(360deg); }
}

/* ---------- DONE (제출 완료) ---------- */
article.ask-done {
  display: none;
  flex-direction: column;
  align-items: center;
  padding: 12rem 2rem 20rem;
  width: 100%;
  text-align: center;
}

article.ask-done.show {
  display: flex;
}

article.ask-done .check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 8rem;
  height: 8rem;
  margin: 0 0 3rem;
  border-radius: 50%;
  background: var(--gradient);
}

article.ask-done .check::before {
  content: "";
  width: 2.6rem;
  height: 1.4rem;
  border-left: 3px solid #fff;
  border-bottom: 3px solid #fff;
  transform: translateY(-15%) rotate(-45deg);
}

article.ask-done p {
  max-width: 50rem;
  font-size: 1.6rem;
  font-weight: 500;
  color: var(--color-text);
  line-height: 2.5rem;
}

article.ask-done .btn-primary {
  margin-top: 3.2rem;
}

/* ---------- PC: 연락처 칸 전체 폭 ---------- */
@media (min-width: 676px) {
  article.ask-form section[data-title="연락처"] {
    width: 100%;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 675px) {
  .ask-main {
    margin: 0 auto;
    width: 100%;
  }

  .ask-main::before {
    height: 6rem;
  }

  /* BANNER */
  article.ask-banner {
    margin: 0 auto;
    padding: 0 0 0 2rem;
    width: calc(100% - 3rem);
    height: 15rem;
    border-radius: 1.4rem;
  }

  article.ask-banner h1 {
    font-size: 2rem;
    line-height: 2.4rem;
  }

  article.ask-banner h2 {
    margin: 1.2rem 0 0 0;
    padding: 0 2rem 0 0;
    font-size: 1.1rem;
    line-height: 1.8rem;
  }

  /* TITLE */
  article.ask-title {
    margin: 6rem 0 0 0;
    width: 100%;
    height: 6rem;
    font-size: 2.3rem;
  }

  /* CATEGORY */
  article.ask-ctg {
    height: 32rem;
    padding: 0;
  }

  article.ask-ctg::after {
    left: 1.5rem;
    width: calc(100% - 3rem);
  }

  article.ask-ctg h2 {
    padding: 0 1.5rem;
    font-size: 2rem;
    line-height: 2rem;
    text-align: center;
  }

  article.ask-ctg div.container {
    width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
  }

  article.ask-ctg div.container::-webkit-scrollbar {
    display: none;
  }

  article.ask-ctg div.container div.wrapper {
    display: flex;
    flex-flow: row nowrap;
    justify-content: flex-start;
    align-items: flex-start;
    margin: 4rem 0 0 1.5rem;
    width: max-content;
  }

  article.ask-ctg div.container div.wrapper label {
    margin: 0 2rem 0 0;
    width: 22vw;
    height: 18rem;
    font-size: 1.2rem;
    background-size: 5.5rem 5.5rem;
  }

  /* FORM */
  article.ask-form {
    margin: 0 auto;
    width: calc(100% - 3rem);
    padding: 0;
  }

  article.ask-form section {
    padding: 0 1.5rem 0 12rem;
    width: 100%;
    height: 8rem;
  }

  article.ask-form section::before {
    left: 1.5rem;
    font-size: 1.6rem;
  }

  article.ask-form section input[type="text"] {
    font-size: 1.4rem;
  }

  /* MSG */
  article.ask-msg {
    margin: 0 auto;
    padding: 3rem 0 10rem 0;
    width: calc(100% - 3rem);
  }

  article.ask-msg h3 {
    padding: 0 1.5rem;
    font-size: 1.7rem;
    line-height: 1.7rem;
  }

  article.ask-msg textarea {
    margin: 1.5rem 1.5rem 0;
    padding: 1.5rem;
    width: calc(100% - 3rem);
    height: 26rem;
    font-size: 1.4rem;
  }

  article.ask-msg .msg-count {
    margin: 0.8rem 1.5rem 0 0;
    width: calc(100% - 3rem);
  }

  article.ask-msg div.agree {
    margin: 1rem 1.5rem 0;
    padding: 1.5rem;
    width: calc(100% - 3rem);
    font-size: 1.1rem;
    line-height: 1.7rem;
  }

  article.ask-msg div.agree ul {
    margin: 0 0 1rem 2rem;
  }

  article.ask-msg div.agree ul:last-of-type {
    margin: 0 0 0 2rem;
  }

  article.ask-msg button {
    margin: 2.5rem 1.5rem 0;
    width: calc(100% - 3rem);
    height: 5.4rem;
    font-size: 1.6rem;
  }

  article.ask-done {
    padding: 6rem 1.5rem 12rem;
  }

  article.ask-done p {
    font-size: 1.5rem;
    line-height: 2.4rem;
  }
}
