/* 기존 폼은 그대로 두고 이 페이지에서만 하단 레이어로 표시한다. */
/* 스크롤 잠금 전후에도 스크롤바 자리를 유지해 가로 이동을 막는다. */
html { scrollbar-gutter: stable; }
html:has(#counselSheet[open]) { overflow: hidden; }
#invest1.has-floating-form { padding-bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
.counsel-floating-bar {
  position: fixed; z-index: 100; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(100%, 820px); padding: 12px 16px calc(20px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #1c2a7a; background: #040b25;
}
.counsel-floating-open {
  display: block; width: 100%; min-height: 54px; padding: 12px;
  border: 0; border-radius: 12px; background: #63e3ff; color: #040a2b;
  font: inherit; font-size: 16px; font-weight: 900; line-height: 1.5; cursor: pointer;
}
.counsel-floating-open:focus-visible, .counsel-sheet-close:focus-visible { outline: 3px solid #2c2bb8; outline-offset: 3px; }
.counsel-sheet {
  width: min(100%, 820px); max-width: 100%; max-height: calc(100dvh - 16px);
  margin: auto auto 0; padding: 0; border: 0; border-radius: 20px 20px 0 0;
  background: #fff; color: #1d1f2c; overflow-y: auto; overscroll-behavior: contain;
}
.counsel-sheet::backdrop { background: rgba(2, 5, 24, 0.7); }
.counsel-sheet[open] { animation: counsel-sheet-enter 320ms cubic-bezier(0.22, 1, 0.36, 1); }
.counsel-sheet[open]::backdrop { animation: counsel-sheet-shade 240ms ease-out; }
.counsel-sheet-header {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 16px 20px 12px; background: #fff;
}
.counsel-sheet-header h2 { margin: 0; font-size: 17px; line-height: 1.5; font-weight: 900; }
.counsel-sheet-close {
  display: flex; align-items: center; justify-content: center; flex: none;
  width: 44px; height: 44px; padding: 0; border: 0; background: transparent;
  color: #33384a; font: inherit; font-size: 28px; line-height: 1; cursor: pointer;
}
#invest1 .counsel-sheet .form_section { padding: 0 20px calc(24px + env(safe-area-inset-bottom, 0px)); background: #fff; }
#invest1 .counsel-sheet .verify-form #form { margin: 0 0 16px; padding: 0; border-radius: 0; }
#invest1 .counsel-sheet .privacy_box { align-items: flex-start; }
#invest1 .counsel-sheet .privacy_box .agreeText.cursor { flex: none; white-space: nowrap; }
.counsel-sheet .modal { z-index: 10; }
@keyframes counsel-sheet-enter { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes counsel-sheet-shade { from { background: rgba(2, 5, 24, 0); } to { background: rgba(2, 5, 24, 0.7); } }
@media (prefers-reduced-motion: reduce) {
  .counsel-sheet[open], .counsel-sheet[open]::backdrop { animation: none; }
}

/* 연락처와 인증 동작을 같은 입력 테두리 안에 배치한다. */
#invest1 .counsel-sheet [data-integrated-verification] .phone-verification {
  display: grid; grid-template-columns: minmax(0, 1fr) 110px; gap: 8px 0; flex: 1; min-width: 0;
}
#invest1 .counsel-sheet [data-integrated-verification] .phone-input-field {
  grid-column: 1 / -1; grid-row: 1; display: flex; min-width: 0; height: var(--cv-h);
  border: var(--cv-border); border-radius: var(--cv-radius); overflow: hidden; background: #fff;
}
#invest1 .counsel-sheet [data-integrated-verification] .phone-verification:has(.cv-box:not([hidden]) .cv-send:not([hidden])) .phone-input-field {
  grid-column: 1; border-right: 0; border-radius: var(--cv-radius) 0 0 var(--cv-radius);
}
#invest1 .counsel-sheet [data-integrated-verification] .phone-input-field .hp-prefix {
  width: 52px; height: 100%; padding: 0; justify-content: center; border-radius: 0; background: #2b31c4;
}
#invest1 .counsel-sheet [data-integrated-verification] .phone-input-field input.phone_8 {
  flex: 1; min-width: 0; width: 100%; height: 100%; padding: 0 12px; border: 0; border-radius: 0;
  font-family: inherit; font-size: 16px; background: #fff; outline: none;
}
#invest1 .counsel-sheet [data-integrated-verification] .phone-input-field:focus-within,
#invest1 .counsel-sheet [data-integrated-verification] .phone-verification:has(.phone-input-field:focus-within) .cv-send,
#invest1 .counsel-sheet [data-integrated-verification] .cv-row:focus-within { border-color: #2b31c4; }
#invest1 .counsel-sheet [data-integrated-verification] .cv-box { display: contents; }
#invest1 .counsel-sheet [data-integrated-verification] .cv-btn-row {
  grid-column: 2; grid-row: 1; display: flex; width: auto; min-width: 0;
}
#invest1 .counsel-sheet [data-integrated-verification] .cv-btn-row:has(.cv-send[hidden]) { display: none; }
#invest1 .counsel-sheet [data-integrated-verification] .cv-btn {
  background: #2b31c4; color: #fff; font-size: 13px;
}
#invest1 .counsel-sheet [data-integrated-verification] .cv-btn:disabled { background: #eceef4; color: #6b7080; }
#invest1 .counsel-sheet [data-integrated-verification] .cv-btn-row .cv-send {
  width: 110px; min-width: 0; padding: 0 10px; border: var(--cv-border); border-left: 0;
  border-radius: 0 var(--cv-radius) var(--cv-radius) 0;
}
#invest1 .counsel-sheet [data-integrated-verification] .cv-row {
  grid-column: 1 / -1; grid-row: 2; flex-wrap: nowrap; gap: 0; height: var(--cv-h);
  border: var(--cv-border); border-radius: var(--cv-radius); overflow: hidden; background: #fff;
}
#invest1 .counsel-sheet [data-integrated-verification] .cv-code-wrap { height: 100%; }
#invest1 .counsel-sheet [data-integrated-verification] input.cv-code {
  height: 100%; padding: 0 60px 0 12px; border: 0; border-radius: 0; box-shadow: none;
}
#invest1 .counsel-sheet [data-integrated-verification] .cv-msg { grid-column: 1 / -1; grid-row: 3; margin: 0; }
.counsel-submit {
  display: block; width: 100%; min-height: 54px; padding: 12px; border: 0; border-radius: 12px;
  background: #2b31c4; color: #fff; font: inherit; font-size: 16px; font-weight: 900; line-height: 1.5; cursor: pointer;
}
.counsel-submit:disabled { background: #e6e7ef; color: #6b7080; cursor: default; }
.counsel-submit:focus-visible { outline: 3px solid #2b31c4; outline-offset: 3px; }
.counsel-complete { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 12px 20px 26px; text-align: center; }
.counsel-complete[hidden] { display: none; }
.counsel-complete:focus { outline: none; }
.counsel-complete h3 { margin: 0; color: #1d1f2c; font-size: 18px; font-weight: 900; line-height: 1.5; }
@media (max-width: 480px) {
  #invest1 .counsel-sheet [data-integrated-verification] .input-row { flex-direction: column; align-items: stretch; gap: 6px; }
  #invest1 .counsel-sheet [data-integrated-verification] .input-row > label { min-width: 0; margin: 0; }
  #invest1 .counsel-sheet [data-integrated-verification] .input-row > input[type='text'] { flex: none; width: 100%; }
}
