/* ─────────────────────────────────────────────────────────────
   인증 화면 (로그인 · 인증코드 입력 · 가입 안내)

   레이아웃은 세 화면이 공유합니다.
     전체폭 상단바  →  가운데 460px 본문  →  전체폭 푸터 밴드

   수치는 디자인 원본(튜브워커 로그인 페이지.dc.html) 기준입니다.
   색은 전부 토큰이며, 투명도만 다른 파생색은 color-mix 로 만듭니다.
   ───────────────────────────────────────────────────────────── */

.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
}

/* ── 상단바 ── */
.auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 16px clamp(20px, 5vw, 48px);
  border-bottom: 1px solid var(--border);
  background: var(--surface-bar);
}

/* 브랜드는 홈(랜딩)으로 가는 링크입니다 — 퍼플 'T' 배지 + 워드마크(v3). */
.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: var(--brand);
  text-decoration: none;
}

.auth-brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  font-size: 15px;
  line-height: 1;
}

.auth-brand-word {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: var(--tracking-tight);
}

.auth-topbar-actions {
  display: flex;
  align-items: center;
  gap: clamp(8px, 2vw, 14px);
}

.auth-topbar-link {
  text-decoration: none;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 500;
  transition: color .2s;
}

.auth-topbar-link:hover { color: var(--text); }

/* 로그아웃은 POST 폼이라 button 인데 링크처럼 보여야 합니다. */
.auth-topbar-form { margin: 0; display: inline-flex; }

button.auth-topbar-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  cursor: pointer;
}

/* 테마 토글(.theme-toggle)은 랜딩과 공유하므로 tokens.css 의 공용 컴포넌트에 있습니다. */

/* ── 본문 ── */
.auth-main {
  flex: 1;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  /* 위 여백이 아래보다 큽니다 — 내용을 화면 중앙보다 살짝 아래에 앉힙니다. */
  padding: clamp(72px, 10vw, 120px) clamp(24px, 5vw, 40px) clamp(48px, 7vw, 84px);
  text-align: center;
}

.auth-eyebrow {
  font: 700 14px var(--font-serif);
  letter-spacing: 3px;
  color: var(--accent);
  margin-bottom: 30px;
}

/* 인증코드 화면은 아래 여백이 조금 좁습니다. */
.auth-eyebrow--code { margin-bottom: 26px; }

.auth-title {
  margin: 0 0 12px;
  font: 600 clamp(25px, 4vw, 30px) var(--font-serif);
  color: var(--text);
}

/* "환영합니다" — 인증코드 입력 화면 */
.auth-title--code {
  margin: 0 0 16px;
  font-size: clamp(23px, 4vw, 27px);
}

/* "이제 한 가지 절차만 남았습니다" — 가입 안내 화면 */
/* ── 승인 대기 화면 ────────────────────────────────────────────
   큰 글자를 하나만 둡니다. 인사(환영합니다!)가 제목이고, 인증 완료는 결과 보고,
   본문은 상자 안입니다 — 셋을 같은 크기로 두면 무엇이 이 화면의 말인지 흐려집니다. */
.auth-title--welcome {
  margin: 0 0 22px;
  font-size: clamp(24px, 4.4vw, 28px);
}

.pending-done {
  margin: 0 0 22px;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

/* 이 상자가 본문입니다. 사용자가 알아야 하는 두 가지를 한 덩어리로 묶어 눈이 갈
   자리를 하나로 만듭니다 — 문장으로 흩어 두면 대기 기간이 안 읽힙니다. */
.pending-card {
  margin: 0 0 28px;
  padding: 20px 18px;
  border: 1px solid color-mix(in srgb, var(--accent) 34%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.pending-lead {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.6;
  color: var(--accent);
}

.pending-desc {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--text-muted);
}

/* 세 걸음. 기다리는 화면에서 가장 궁금한 "지금 어디쯤인가"에 답합니다 — 멈춘 것이
   아니라 진행 중이고 남은 것이 하나뿐이라는 것이 함께 읽힙니다. */
.pending-steps {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pending-steps li {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  position: relative;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-faint);
}

/* 걸음 사이를 잇는 선. 마지막 것에는 이어질 곳이 없으므로 안 그립니다. */
.pending-steps li:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 15px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 1px;
  background: var(--border);
}

.pending-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 13px;
  line-height: 1;
}

.pending-steps .is-done { color: var(--text-muted); }

.pending-steps .is-done .pending-dot {
  border-color: color-mix(in srgb, var(--success) 50%, transparent);
  background: color-mix(in srgb, var(--success) 14%, transparent);
  color: var(--success);
}

/* 지금 걸음만 색과 굵기를 씁니다 — 하나만 도드라져야 어디인지 한눈에 보입니다. */
.pending-steps .is-now { color: var(--accent); font-weight: 700; }

.pending-steps .is-now .pending-dot {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
}

/* ── 실명·닉네임 입력 (거의 다 왔어요) ──
   위 헤더는 가운데 정렬(auth-*)이고, 입력칸부터는 왼쪽 정렬입니다. */
.nick-form { text-align: left; }

/* 입력칸 한 벌(라벨·칸·안내문)을 묶습니다. 칸이 여럿이라 사이가 붙으면
   어느 안내문이 어느 칸 것인지 알아보기 어렵습니다. */
.nick-field + .nick-field { margin-top: 20px; }

/* 세 칸이 모두 필수라는 안내. 입력칸 위에 한 번 말해 두고, 칸마다 * 로 다시 표시합니다.
   한 번만 말하면 스크롤해서 내려간 사람이 놓칩니다. */
.nick-required-note {
  margin: 0 0 22px;
  padding: 11px 13px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-muted);
  font-size: 12.5px;
  line-height: 1.6;
  text-align: left;
  color: var(--text-muted);
}

.nick-required {
  color: var(--danger);
  font-weight: 700;
}

.nick-label {
  display: block;
  margin-bottom: 9px;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
}

.nick-input {
  width: 100%;
  padding: 15px 16px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 11px;
  font-family: inherit;
  font-size: 15.5px;
  color: var(--text);
  outline: none;
  transition: border-color .2s ease;
}

.nick-input:focus { border-color: var(--accent); }

.nick-help {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin: 8px 2px 0;
  font-size: 12px;
  color: var(--text-faint);
}

.nick-help-text { font-weight: 500; }

.nick-count { flex: none; }

.nick-next { margin-top: 30px; }

/* ── 혜택 배지 ── */
.auth-badge {
  margin-top: 22px;
  display: flex;
  align-items: center;
  gap: 9px;
  justify-content: center;
  padding: 13px 16px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  border-radius: var(--radius-md);
}

.auth-badge-emoji { font-size: 15px; }

.auth-badge-text {
  font-size: 13px;
  color: var(--accent);
  font-weight: 700;
}

/* ── 완료 체크 ── */
.auth-check {
  width: 66px;
  height: 66px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1.5px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 26px;
  font-size: 30px;
  color: var(--accent);
  line-height: 1;
}

/* ─────────────────────────────────────────────────────────────
   인증코드 입력
   시각적으로는 6칸 박스지만 실제 입력은 그 위에 겹친 단일 input 하나입니다.
   (붙여넣기·자동완성·스크린리더가 정상 동작합니다.)
   ───────────────────────────────────────────────────────────── */
.code-field {
  position: relative;
  margin: 0 0 28px;
}

.code-slots {
  display: flex;
  gap: 8px;
  justify-content: center;
  pointer-events: none;
}

.code-slot {
  width: clamp(38px, 10vw, 46px);
  height: 56px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  font: 600 22px var(--font-serif);
  color: var(--text-faint);
  transition: border-color .2s ease, color .2s ease;
}

.code-slot[data-filled='true'] { color: var(--text); }

.code-field:focus-within .code-slot[data-active='true'] {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 30%, transparent);
}

/* 실제 입력 필드 — 박스 위에 투명하게 겹칩니다. */
.code-input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: none;
  background: none;
  font-size: 22px;
  letter-spacing: 1em;
  text-align: center;
  cursor: pointer;
}

.code-input:focus { outline: none; }

/* JS 가 꺼져 있으면 박스를 감추고 평범한 입력창을 보여줍니다. */
.no-js .code-slots { display: none; }

.no-js .code-input {
  position: static;
  opacity: 1;
  width: 100%;
  height: 56px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  letter-spacing: .4em;
}

/* ── 오류 메시지 (원본에 없는 우리 추가분 — 디자인 톤에 맞춤) ── */
.auth-error {
  margin: 0 0 18px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
  border: 1px solid var(--accent);
  color: var(--accent-quiet);
  font-size: 13.5px;
  line-height: 1.6;
  text-align: left;
}

/* ── 문의 · 안내 문구 ── */
.auth-contact {
  margin: 20px 0 0;
  font-size: 13px;
  color: var(--text-faint);
}

.auth-contact a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.auth-contact a:hover { color: var(--accent-hover); }

.auth-fineprint {
  margin: 24px 0 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 0 4px;
}

.auth-fineprint p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-faint);
}

.auth-fineprint a {
  color: var(--accent);
  text-decoration: none;
  font-weight: 700;
}

.auth-fineprint a:hover { color: var(--accent-hover); }

/* 잔글씨를 가운데로. 이 화면은 통째로 가운데 정렬이라 여기만 왼쪽이면 아래가
   기울어 보입니다(신청서 화면은 입력칸이 왼쪽이라 그쪽이 맞습니다). */
.auth-fineprint--center {
  align-items: center;
  text-align: center;
  /* 단계 표시와 넉넉히 띄웁니다 — 붙어 있으면 잔글씨가 그 줄에 딸린 설명처럼
     읽혀서, 구분선이 있어도 다른 이야기라는 것이 잘 안 보입니다. */
  margin-top: clamp(40px, 7vw, 56px);
  /* 선 아래도 띄웁니다 — 붙어 있으면 선이 글에 밑줄처럼 달라붙어, 위아래를 가르는
     구실을 못 하고 잔글씨만 눌린 것처럼 보입니다. */
  padding-top: clamp(22px, 4vw, 28px);
  border-top: 1px solid var(--border);
}

.auth-title--pending {
  margin: 0 0 18px;
  font-size: clamp(22px, 4vw, 25px);
  line-height: 1.4;
}

/* "거의 다 왔어요" — 닉네임 입력 화면 */
.auth-title--nickname {
  margin: 0 0 12px;
  font-size: clamp(23px, 4vw, 27px);
}

.auth-lead {
  margin: 0 0 36px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--text-muted);
}

/* 인증코드 화면 첫 문단 — 두 번째 문단이 바로 뒤에 붙습니다. */
.auth-lead--tight {
  margin: 0 0 8px;
  line-height: 1.75;
}

/* 인증코드 화면 두 번째 문단 */
.auth-lead--sub {
  margin: 18px 0 26px;
  font-size: 14px;
  line-height: 1.75;
}

/* 가입 안내 화면 첫 문단 */
.auth-lead--pending {
  margin: 0 0 14px;
  line-height: 1.8;
}

.auth-highlight {
  margin: 0 0 30px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--accent);
  font-weight: 700;
}

.auth-note {
  margin: 16px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--text-faint);
}

/* ── 버튼 ── */
.btn-kakao {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 16px;
  background: var(--kakao);
  color: var(--kakao-on);
  border: none;
  border-radius: var(--radius-lg);
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  transition: all .25s ease;
}

.btn-kakao:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px var(--kakao-shadow);
}

.btn-kakao:active { transform: translateY(0); }

.btn-primary {
  display: block;
  width: 100%;
  padding: 15px;
  background: var(--accent);
  color: var(--accent-on-solid);
  border: none;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: all .25s ease;
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px color-mix(in srgb, var(--accent) 42%, transparent);
}

.btn-primary:active { transform: translateY(0); }

/* 닉네임 화면 "다음" — 2자 미만이면 JS 가 잠급니다(원본의 회색 비활성 버튼). */
.btn-primary:disabled {
  background: var(--border-strong);
  color: var(--text-faint);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ── 푸터 밴드 ── */

/* ── 인증번호 남은 시간 · 다시 받기 ───────────────────────────
   남은 시간은 곧 재발송 쿨타임입니다 — 0 이 되면 화면이 다시 그려지면서 아래
   '다시 받기' 가 열립니다. 그래서 둘을 같은 값으로 채우고 나란히 둡니다. */
.auth-timer {
  margin: 14px 0 18px;
  font-size: 13px;
  color: var(--text-muted);
}

.auth-timer b {
  font-variant-numeric: tabular-nums;  /* 숫자가 바뀔 때 폭이 안 흔들리게 */
  color: var(--text);
}

/* 버튼과 링크가 같은 자리에 번갈아 오므로(잠김/열림) 생김새를 하나로 맞춥니다. */
.auth-linkbtn {
  padding: 0;
  border: 0;
  background: none;
  font: inherit;
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.auth-linkbtn:hover:not(:disabled) { color: var(--accent-hover); }

.auth-linkbtn:disabled {
  color: var(--text-faint);
  cursor: default;
}

/* ── 전화번호·인증번호 줄 ──────────────────────────────────────
   칸 하나와 오른쪽 버튼 하나. 두 줄이 같은 모양이라, 발송을 누르면 아래에 같은
   생김새의 줄이 하나 더 생기는 것으로 보입니다. */
.phone-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}

.phone-row .nick-input { flex: 1 1 auto; min-width: 0; }

/* 주 버튼과 같은 보라를 씁니다 — 이 줄에서 실제로 눌러야 하는 것이라 회색으로
   두면 안내문처럼 보입니다. 다만 폭은 글자만큼이고 아래 '가입 신청하기' 가 줄을
   다 쓰므로, 무엇이 마지막 걸음인지는 크기로 갈립니다. */
.phone-send {
  flex: 0 0 auto;
  padding: 0 16px;
  border: none;
  border-radius: var(--radius-md);
  background: var(--accent);
  color: var(--accent-on-solid);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
  transition: background .2s ease;
}

.phone-send:hover:not(:disabled) { background: var(--accent-hover); }

/* 쿨타임 동안 남은 시간을 세는 상태. 회색으로 두어 지금 누를 것이 아님을 알립니다. */
.phone-send:disabled {
  background: var(--border-strong);
  color: var(--text-faint);
  cursor: not-allowed;
}

/* 두 문장을 한 문단으로 흘립니다. 나눠 두면 앞 문장이 규칙이고 뒤 문장이 근거인
   관계가 끊겨서, 각자 다른 말처럼 읽힙니다. 앞 문장만 눈에 띄게 두어 '직접 고치는
   것이 예외' 라는 것이 먼저 읽히게 합니다. */
.phone-note {
  margin: 8px 2px 0;
  font-size: 12px;
  line-height: 1.6;
  color: var(--text-faint);
}

.phone-note b {
  font-weight: 700;
  color: var(--accent);
}

/* 인증이 끝났다는 표시. 번호를 고치면 사라지므로 "지금 이 번호가 확인됐다"는 뜻입니다. */
.phone-verified {
  margin: 8px 0 22px;
  font-size: 13px;
  font-weight: 700;
  color: var(--success);
}

/* 곁들이 버튼 — [변경]·[취소]. 주 동작(발송·인증 확인)과 같은 크기지만 색을 빼서,
   한 줄에 버튼이 둘일 때 어느 쪽이 지금 할 일인지 갈립니다. */
.phone-send--quiet {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-muted);
}

.phone-send--quiet:hover:not(:disabled) {
  background: transparent;
  border-color: var(--accent);
  color: var(--accent);
}
