/* ═══════════════════════════════════════════════════════════════
   휴대폰 모양 모달 (PC 웹 → 예약 → 폰 프레임 안에서 진행)
   ═══════════════════════════════════════════════════════════════ */

.phone-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  align-items: center;
  justify-content: flex-end;
}

.phone-modal.is-open {
  display: flex;
  animation: phoneModalFadeIn 0.25s ease-out;
}

@keyframes phoneModalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* ── 배경 어둡게 ──────────────────────────────────────────── */
.phone-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
}

/* ── 휴대폰 프레임 ─────────────────────────────────────────── */
.phone-frame {
  position: relative;
  width: 380px;
  height: 780px;
  max-height: calc(100vh - 40px);
  margin-right: 40px;
  background: #1a1a1a;
  border-radius: 36px;
  padding: 10px;
  box-shadow: 0 25px 70px rgba(0, 0, 0, 0.5);
  animation: phoneSlideIn 0.35s cubic-bezier(0.2, 0.9, 0.3, 1.0);
  flex-shrink: 0;
}

@keyframes phoneSlideIn {
  from { transform: translateX(120%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ── 닫기 버튼 (X) ────────────────────────────────────────── */
.phone-close {
  position: absolute;
  top: -8px;
  left: -48px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: none;
  font-size: 22px;
  color: #1a1a1a;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
  transition: transform 0.15s;
}
.phone-close:hover { transform: scale(1.05); }

/* ── 휴대폰 화면 ───────────────────────────────────────────── */
.phone-screen {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 28px;
  overflow: hidden;
  background: #fff;
}

/* ── 노치 (휴대폰 상단 카메라/스피커) ───────────────────── */
.phone-notch {
  display: none;
}

/* ── 화면 컨테이너 (단계별로 교체될 영역) ────────────────── */
.phone-content {
  position: relative;
  width: 100%;
  height: 100%;
}

.phone-step {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
}
.phone-step.is-active {
  display: flex;
}

/* ════════════════════════════════════════════════════════════
   Step 1: 전화번호 입력 (배경 이미지 사용)
   ════════════════════════════════════════════════════════════ */
.phone-step-phone {
  background: url('/web/phone-bg-code.webp') center center / cover no-repeat;
  padding: 0;
}

/* 입력 폼 오버레이 (배경 이미지의 폼 위치에 맞춰 배치) */
.phone-form-overlay {
  position: absolute;
  left: 17%;
  right: 17%;
  bottom: 40.5%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.phone-input {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: none;
  background: rgba(255, 255, 255, 0.85);
  font-size: 20px;
  font-weight: 600;
  letter-spacing: 1px;
  font-family: inherit;
  color: #1a1a1a;
  outline: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.phone-input::placeholder { color: #9ca3af; }

.phone-input:focus {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.4);
}

.phone-btn-primary {
  width: 100%;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid #4c1d95;
  background: rgba(124, 58, 237, 0.92);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, transform 0.1s;
  backdrop-filter: blur(4px);
}

.phone-btn-primary:hover  { background: rgba(124, 58, 237, 1); }
.phone-btn-primary:active { transform: scale(0.98); }
.phone-btn-primary:disabled {
  background: rgba(124, 58, 237, 0.5);
  cursor: not-allowed;
}

.phone-error {
  position: absolute;
  left: 12%;
  right: 12%;
  bottom: 30%;
  text-align: center;
  color: #dc2626;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
  min-height: 18px;
}

/* ════════════════════════════════════════════════════════════
   Step 2A: 인증번호 6자리 입력 (배경 이미지 사용)
   ════════════════════════════════════════════════════════════ */
.phone-step-code {
  background: url('/web/phone-bg-code.webp') center center / cover no-repeat;
  padding: 0;
}

/* 발송 안내 (전화번호 표시) */
.phone-code-info {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 38%;
  text-align: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.phone-code-info-phone {
  display: block;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 700;
}

/* "인증번호 6자리를 입력해주세요" 안내 */
.phone-code-label {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 45%;
  text-align: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* 6자리 입력 칸 */
.phone-code-boxes {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 50%;
  display: flex;
  gap: 6px;
  justify-content: center;
}
.phone-code-box {
  flex: 1;
  max-width: 46px;
  height: 56px;
  border: 2px solid rgba(124, 58, 237, 0.3);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.85);
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: #3C3489;
  outline: none;
  font-family: inherit;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: border-color 0.15s, background 0.15s;
}
.phone-code-box:focus {
  border-color: #7c3aed;
  background: rgba(255, 255, 255, 0.95);
}
.phone-code-box.is-filled {
  border-color: #7c3aed;
}

/* 타이머 + 재전송 */
.phone-code-timer {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 59%;
  text-align: center;
  font-size: 12px;
  color: #fff;
  font-weight: 600;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}
.phone-code-timer .resend-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 6px;
  font-family: inherit;
}
.phone-code-timer .resend-btn:disabled {
  color: #9ca3af;
  cursor: not-allowed;
}
.phone-code-timer .timer-text {
  margin-left: 8px;
}

/* 확인 버튼 */
.phone-code-submit {
  position: absolute;
  left: 12%;
  right: 12%;
  top: 62%;
}

/* 전화번호 변경하기 링크 */
.phone-code-change {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 70%;
  text-align: center;
}
.phone-code-change button {
  background: none;
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* 코드 입력 화면 에러 */
.phone-code-error {
  position: absolute;
  left: 8%;
  right: 8%;
  top: 62%;
  text-align: center;
  color: #dc2626;
  font-size: 12px;
  font-weight: 600;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.6);
  min-height: 18px;
}

/* ════════════════════════════════════════════════════════════
   Step 3: 로그인 완료 → iframe으로 앱 표시
   ════════════════════════════════════════════════════════════ */
.phone-step-loggedin {
  background: #fff;
  padding: 0;
}
.phone-app-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ════════════════════════════════════════════════════════════
   반응형: 모바일에서는 풀스크린
   ════════════════════════════════════════════════════════════ */
@media (max-width: 480px) {
  .phone-modal { justify-content: center; }
  .phone-frame {
    width: 100vw;
    height: 100vh;
    max-height: 100vh;
    margin-right: 0;
    border-radius: 0;
    padding: 0;
  }
  .phone-screen { border-radius: 0; }
  .phone-notch { display: none; }
  .phone-close {
    top: 12px;
    left: auto;
    right: 12px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
  }
}
