/* ===== 인증 오버레이 (로그인/회원가입) ===== */
.auth-overlay {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #6c5ce7 0%, #a29bfe 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 16px;
}
.auth-card {
  background: #fff;
  border-radius: 16px;
  padding: 22px 26px;
  width: 100%;
  max-width: 360px;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  transition: max-width 0.2s ease;
}
.auth-card.is-register {
  max-width: 900px;
}
.auth-card::-webkit-scrollbar {
  width: 6px;
}
.auth-card::-webkit-scrollbar-thumb {
  background: #c8cad6;
  border-radius: 3px;
}
.auth-logo {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin-bottom: 14px;
}
.auth-tabs {
  display: flex;
  margin-bottom: 14px;
  border-bottom: 2px solid var(--border);
}
.auth-tab {
  flex: 1;
  padding: 10px;
  border: none;
  background: transparent;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-soft);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all 0.15s;
  font-family: inherit;
}
.auth-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}
.auth-field {
  margin-bottom: 10px;
}
.auth-field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  margin-bottom: 4px;
}
.auth-field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.auth-field input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.12);
}
.auth-error {
  color: var(--danger);
  font-size: 13px;
  min-height: 18px;
  margin: 8px 0;
}
.auth-options {
  display: flex;
  gap: 16px;
  margin-bottom: 12px;
}
.auth-options.hidden {
  display: none;
}
.auth-checkbox {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-soft);
  cursor: pointer;
  user-select: none;
}
.auth-checkbox input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary);
}
.btn-auth-submit {
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s;
  font-family: inherit;
}
.btn-auth-submit:hover {
  background: var(--primary-dark);
}
.btn-auth-submit:disabled {
  background: #c8cad6;
  cursor: not-allowed;
}
.auth-hint {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 12px;
  line-height: 1.5;
}
.auth-links {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.auth-link {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 6px;
  font-family: inherit;
  transition: color 0.15s;
}
.auth-link:hover {
  color: var(--primary-dark);
  text-decoration: underline;
}
.auth-link-sep {
  color: var(--muted);
  font-size: 12px;
  user-select: none;
}

/* =====================================================
   회원가입 3단계 스텝퍼
   ===================================================== */
.auth-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
  padding: 2px 0 0;
}
.auth-stepper.hidden {
  display: none;
}
.stepper-item {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
}
.stepper-circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #e4e6ef;
  color: var(--text-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  font-weight: 700;
  transition: background 0.15s, color 0.15s;
}
.stepper-item.active .stepper-circle {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(108, 92, 231, 0.15);
}
.stepper-item.done .stepper-circle {
  background: var(--primary);
  color: #fff;
  opacity: 0.7;
}
.stepper-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
}
.stepper-item.active .stepper-label {
  color: var(--primary);
}
.stepper-arrow {
  color: var(--muted);
  font-size: 16px;
  font-weight: 700;
  user-select: none;
}

/* =====================================================
   회원가입 step 공통
   ===================================================== */
.auth-step {
  animation: fadeInStep 0.2s ease;
}
.auth-step.hidden {
  display: none;
}
@keyframes fadeInStep {
  from { opacity: 0; transform: translateY(4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.step-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.step-actions .btn {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s, opacity 0.15s;
}
.step-actions .btn-cancel {
  background: #e4e6ef;
  color: var(--text-soft);
}
.step-actions .btn-cancel:hover {
  background: #d3d6e0;
}
.step-actions .btn-confirm {
  background: var(--primary);
  color: #fff;
}
.step-actions .btn-confirm:hover {
  background: var(--primary-dark);
}
.step-actions .btn-confirm:disabled,
.step-actions .btn:disabled {
  background: #c8cad6;
  color: #fff;
  cursor: not-allowed;
  opacity: 0.7;
}
.step-actions .btn-auth-submit {
  flex: 1;
  padding: 12px;
  font-size: 14px;
  font-weight: 700;
}

/* =====================================================
   약관 동의 UI
   ===================================================== */
.terms-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 4px;
  cursor: pointer;
  user-select: none;
  font-size: 14px;
  color: var(--text);
}
.terms-row.terms-all {
  padding: 8px 4px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 6px;
}
.terms-row input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: var(--primary);
  flex-shrink: 0;
}
.terms-title {
  font-size: 14px;
}
.terms-hint {
  font-size: 11px;
  color: var(--text-soft);
  margin: 4px 4px 6px;
  line-height: 1.5;
}
.terms-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0 8px;
}
.terms-block {
  display: flex;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 8px;
}
.terms-block .terms-row {
  flex: 0 0 230px;
  background: #f8f9fb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  align-items: flex-start;
  margin: 0;
}
.terms-block .terms-row .terms-title {
  font-size: 13px;
  line-height: 1.4;
}
.terms-box {
  flex: 1;
  max-height: 88px;
  overflow-y: auto;
  background: #f8f9fb;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--text-soft);
  margin-top: 0;
}
.terms-box h4 {
  margin: 10px 0 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
}
.terms-box p {
  margin: 4px 0;
}
.terms-box ul,
.terms-box ol {
  margin: 4px 0;
  padding-left: 20px;
}
.terms-box li {
  margin: 2px 0;
}
.terms-box strong {
  color: var(--text);
}
.terms-box::-webkit-scrollbar {
  width: 6px;
}
.terms-box::-webkit-scrollbar-track {
  background: transparent;
}
.terms-box::-webkit-scrollbar-thumb {
  background: #c8cad6;
  border-radius: 3px;
}
.terms-box::-webkit-scrollbar-thumb:hover {
  background: #a8aab8;
}

/* =====================================================
   회원가입 완료 화면
   ===================================================== */
.register-done {
  text-align: center;
  padding: 24px 0 16px;
}
.register-done-icon {
  font-size: 48px;
  margin-bottom: 12px;
}
.register-done-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 6px;
}
.register-done-meta {
  font-size: 13px;
  color: var(--text-soft);
  margin: 0;
}

/* Step 2 (회원정보 입력): 더 넓어진 카드 안에서 폼이 좌우로 늘어지지 않도록 가운데 정렬 */
.auth-step#auth-step-2 {
  max-width: 460px;
  margin: 0 auto;
  width: 100%;
}

/* 반응형: 좁은 화면에서는 약관을 다시 세로 1열로 + 카드 폭 100% */
@media (max-width: 760px) {
  .auth-card.is-register {
    max-width: 100%;
    padding: 18px 20px;
  }
  .terms-block {
    flex-direction: column;
    gap: 6px;
  }
  .terms-block .terms-row {
    flex: none;
    width: 100%;
  }
  .auth-step#auth-step-2 {
    max-width: 100%;
  }
}

/* ===== App hidden (인증 전) ===== */
body.app-hidden .topbar,
body.app-hidden .container {
  display: none !important;
}

/* ===== 아이디/비밀번호 찾기 + 비밀번호 변경 모달 ===== */
/* 인증 오버레이(z-index:9999) 위에 표시되도록 z-index 상향 */
#find-id-modal,
#find-pw-modal,
#change-pw-modal {
  z-index: 10000;
}
.modal-find {
  max-width: 420px;
  width: 100%;
}
.find-step.hidden {
  display: none;
}
.dev-code-hint {
  background: #fff3cd;
  color: #856404;
  border: 1px solid #ffe69c;
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 12px;
  margin-bottom: 14px;
  line-height: 1.5;
}
.dev-code-hint.hidden {
  display: none;
}
.find-result-icon {
  text-align: center;
  font-size: 56px;
  margin: 12px 0 8px;
  line-height: 1;
}
.find-result-label {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  margin: 8px 0 4px;
}
.find-result-value {
  text-align: center;
  font-size: 22px;
  font-weight: 700;
  color: var(--primary);
  margin: 8px 0;
  letter-spacing: 0.5px;
  word-break: break-all;
}
.find-result-meta {
  text-align: center;
  font-size: 12px;
  color: var(--text-soft);
  margin: 8px 0 20px;
  line-height: 1.5;
}
