/* ==========================================================================
   MillyCard(밀리카드) 공통 스타일시트
   Tailwind 유틸리티로 표현하기 어려운 부분(애니메이션, 세부 인터랙션)만 정의합니다.
   ========================================================================== */

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, 'Malgun Gothic',
    'Apple SD Gothic Neo', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 클릭 가능 요소 커서 ------------------------------------------------------ */
button:not(:disabled),
[type='button']:not(:disabled),
[type='submit']:not(:disabled),
a,
.chk,
[role='button'] {
  cursor: pointer;
}
button:disabled,
[type='button']:disabled,
[type='submit']:disabled {
  cursor: not-allowed;
}

/* 키보드 포커스 표시 -------------------------------------------------------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid #c9922c;
  outline-offset: 2px;
  border-radius: 4px;
}

/* 본문 바로가기(스킵 링크) -------------------------------------------------- */
.skip-link {
  position: absolute;
  top: -48px;
  left: 12px;
  z-index: 300;
  background: #0f172a;
  color: #ffffff;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 12px 20px;
  border-radius: 10px;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 12px;
  outline: 2px solid #c9922c;
  outline-offset: 2px;
}

/* 모션 최소화 환경 대응 ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  *:not(.spinner):not(.spinner *) {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html {
    scroll-behavior: auto;
  }
  .reveal {
    opacity: 1;
    transform: none;
  }
  .card-mock::after {
    display: none;
  }
}

::selection {
  background: #0f172a;
  color: #ffffff;
}

/* 스크롤바 ------------------------------------------------------------- */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: #f1f5f9;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* 스크롤 리빌 애니메이션 ------------------------------------------------ */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.08s; }
.reveal-delay-2 { transition-delay: 0.16s; }
.reveal-delay-3 { transition-delay: 0.24s; }
.reveal-delay-4 { transition-delay: 0.32s; }
.reveal-delay-5 { transition-delay: 0.4s; }

/* 카드 목업 -------------------------------------------------------------- */
.card-mock {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
.card-mock::after {
  content: '';
  position: absolute;
  top: -60%;
  left: -20%;
  width: 60%;
  height: 220%;
  background: linear-gradient(
    115deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.08) 45%,
    rgba(255, 255, 255, 0.14) 50%,
    rgba(255, 255, 255, 0.08) 55%,
    rgba(255, 255, 255, 0) 100%
  );
  transform: rotate(8deg);
  transition: left 1.1s ease;
  z-index: 1;
  pointer-events: none;
}
.card-mock:hover::after {
  left: 120%;
}

/* 칩 아이콘 */
.card-chip {
  background: linear-gradient(135deg, #f2dd9d 0%, #c9922c 55%, #a87322 100%);
}

/* 히어로 배경 그리드 패턴 ------------------------------------------------- */
.hero-grid {
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.08) 1px, transparent 1px);
  background-size: 44px 44px;
}

/* 버튼 hover 미세 인터랙션 ------------------------------------------------ */
.btn-primary {
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background-color 0.25s ease;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px -10px rgba(201, 146, 44, 0.45);
}
.btn-primary:active {
  transform: translateY(0);
}

.btn-outline {
  transition: border-color 0.25s ease, background-color 0.25s ease, transform 0.25s ease;
}
.btn-outline:hover {
  transform: translateY(-2px);
}

.link-underline {
  position: relative;
}
.link-underline::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: -3px;
  width: 0;
  height: 1px;
  background: currentColor;
  transition: width 0.25s ease;
}
.link-underline:hover::after {
  width: 100%;
}

/* 입력창 포커스 글로우 ---------------------------------------------------- */
.input-field {
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}
.input-field:focus {
  border-color: #1e293b;
  box-shadow: 0 0 0 4px rgba(30, 41, 59, 0.08);
}
.input-field.input-error {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}
.input-field.input-success {
  border-color: #16a34a;
  box-shadow: 0 0 0 4px rgba(22, 163, 74, 0.08);
}

/* 커스텀 체크박스 --------------------------------------------------------- */
.chk {
  appearance: none;
  -webkit-appearance: none;
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border: 1.5px solid #cbd5e1;
  border-radius: 6px;
  position: relative;
  cursor: pointer;
  transition: background-color 0.2s ease, border-color 0.2s ease;
}
.chk:checked {
  background-color: #0f172a;
  border-color: #0f172a;
}
.chk:checked::after {
  content: '';
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #ffffff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
.chk:focus-visible {
  outline: 2px solid #c9922c;
  outline-offset: 2px;
}

/* 보안 키패드 ------------------------------------------------------------- */
.keypad-key {
  transition: background-color 0.15s ease, transform 0.1s ease;
}
.keypad-key:active {
  transform: scale(0.94);
  background-color: #1e293b !important;
  color: #fff;
}

/* 아코디언(자주묻는질문 / 약관보기) --------------------------------------- */
.accordion-panel {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.accordion-icon {
  transition: transform 0.3s ease;
}
.accordion-item.is-open .accordion-icon {
  transform: rotate(180deg);
}

/* 비밀번호 강도 바 -------------------------------------------------------- */
.strength-bar {
  transition: width 0.3s ease, background-color 0.3s ease;
}

/* 토스트 알림 ------------------------------------------------------------- */
#toast-root {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  background: #0f172a;
  color: #f8fafc;
  font-size: 0.875rem;
  padding: 12px 20px;
  border-radius: 999px;
  box-shadow: 0 12px 32px -8px rgba(15, 23, 42, 0.5);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  white-space: nowrap;
}
.toast.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* 로딩 스피너 ------------------------------------------------------------- */
.spinner {
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, 0.35);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 완료 체크 애니메이션 (회원가입 4단계) ----------------------------------- */
.check-circle {
  stroke-dasharray: 165.9;
  stroke-dashoffset: 165.9;
  animation: circle-draw 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
.check-mark {
  stroke-dasharray: 48.6;
  stroke-dashoffset: 48.6;
  animation: mark-draw 0.4s 0.55s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}
@keyframes circle-draw {
  to { stroke-dashoffset: 0; }
}
@keyframes mark-draw {
  to { stroke-dashoffset: 0; }
}

/* 모바일 내비게이션 패널 --------------------------------------------------- */
#mobile-menu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
#mobile-menu.is-open {
  max-height: 420px;
}

/* 네비게이션 스크롤 상태 */
#site-header {
  transition: background-color 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}
