/* 방문용 QR코드 웹링크 — 모바일 최적화 스타일 */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --color-bg: #f5f6f8;
  --color-surface: #ffffff;
  --color-text: #1a1a1a;
  --color-sub: #6b7280;
  --color-primary: #2563eb;
  --color-error: #dc2626;
  --color-border: #d1d5db;
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Malgun Gothic", "맑은 고딕", system-ui, sans-serif;
  background: var(--color-bg);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
}

.app {
  min-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

/* 공통 상태 영역 */
.state {
  width: 100%;
  max-width: 420px;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.state__text {
  font-size: 18px;
  color: var(--color-sub);
  line-height: 1.5;
}

/* 로딩 스피너 */
.spinner {
  width: 44px;
  height: 44px;
  border: 4px solid #d9dde3;
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}

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

/* 제목/부제 */
.title {
  font-size: 22px;
  font-weight: 700;
  color: var(--color-primary);
}

.subtitle {
  font-size: 16px;
  color: var(--color-sub);
  line-height: 1.5;
}

/* QR 카드 (정사각형 박스) */
.qr {
  position: relative;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: 12px;
  width: min(75vw, 320px);
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.qr__code {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

/* qrcode.js가 생성하는 img/canvas 반응형 처리 */
.qr__code img,
.qr__code canvas {
  display: block;
  width: 100%;
  height: 100%;
}

/* 오버레이(사용불가 / 표출만료) — QR 박스 전체를 덮음 */
.qr__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 16px;
  text-align: center;
}

.qr__overlay-text {
  font-size: 16px;
  color: var(--color-sub);
  line-height: 1.5;
}

/* 표출 만료 새로고침 아이콘 */
#qr-expired {
  cursor: pointer;
}

.qr__refresh-icon {
  width: 52px;
  height: 52px;
  color: var(--color-sub);
}

/* QR코드 유효시간 */
.valid-time {
  text-align: center;
}

.valid-time__label {
  font-size: 16px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 4px;
}

.valid-time__value {
  font-size: 18px;
  font-weight: 700;
  color: var(--color-error);
  font-variant-numeric: tabular-nums; /* 숫자 폭 고정으로 깜빡임 방지 */
}
