/* biome-ignore-all lint/style/noDescendingSpecificity: 컴포넌트 규칙 뒤에 문맥별 덮어쓰기를 두는 구조라 순서가 의도다 */
/*
 * 작은 창(앱 안 로그인·동의·메일·완료)과 결제 결과, 404. site-v2.css의 .flow·.state·.field 위에 얹는다.
 * 스타일 속성(style=)은 쓰지 않는다(웹 CSP `style-src 'self'`).
 */

.sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

/* 알림 띠는 카드 안 흐름에서 위아래 여백을 가진다 */
.flow-card > .alert {
  margin-top: 18px;
}

.fine {
  margin-top: 22px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.65;
}

.fine a {
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.note-box {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--canvas);
  color: var(--ink-2);
  font-size: 14.5px;
  line-height: 1.6;
}

/* ───────── /login ───────── */

.login-grid {
  display: grid;
  grid-template-columns: minmax(0, 480px);
  justify-content: center;
  width: min(1080px, 100%);
}

.login .flow-card {
  width: 100%;
}

.flow-card .flow-mark {
  display: block;
}

.flow-card .flow-mark + .flow-title {
  margin-top: 20px;
}

.login-aside {
  display: none;
}

.auth-list {
  display: grid;
  gap: 10px;
  margin-top: 26px;
}

/* 켜진 제공자가 하나도 없으면(이메일만) 빈 칸과 "또는" 구분선을 접는다 */
.auth-list:not(:has(.auth-btn:not([hidden]))),
.auth-list:not(:has(.auth-btn:not([hidden]))) + .or-line {
  display: none;
}

.auth-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 52px;
  border: 1px solid var(--line-2);
  border-radius: 14px;
  background: #fff;
  color: #1f1f1f;
  font-size: 16px;
  font-weight: 720;
  transition:
    transform 0.1s ease,
    filter 0.15s ease;
}

.auth-btn:hover {
  filter: brightness(0.96);
}

.auth-btn:active {
  transform: scale(0.99);
}

.auth-logo {
  position: absolute;
  top: 50%;
  left: 18px;
  width: 22px;
  height: 22px;
  transform: translateY(-50%);
  stroke: none;
}

.auth-kakao {
  border-color: #fee500;
  background: #fee500;
  color: rgb(0 0 0 / 85%);
}

.auth-naver {
  border-color: #03c75a;
  background: #03c75a;
  color: #fff;
}

.auth-google {
  border-color: #dadce0;
  background: #fff;
  color: #1f1f1f;
}

.auth-apple {
  border-color: #000;
  background: #000;
  color: #fff;
}

.or-line {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 600;
}

.or-line::before,
.or-line::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
}

.email-box {
  margin-top: 16px;
}

.seg {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 14px;
  background: var(--canvas);
}

.seg button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 15px;
  font-weight: 720;
  cursor: pointer;
}

.seg button[aria-selected="true"] {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 4px rgb(15 28 25 / 10%);
}

.email-box > .alert {
  margin-top: 14px;
}

.eform {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.eform .link-btn {
  justify-self: center;
}

.dev-box {
  margin-top: 18px;
  padding: 14px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-md);
  background: var(--canvas);
}

.dev-note {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink-2);
  font-size: 13px;
}

.dev-note b {
  padding: 2px 7px;
  border-radius: 6px;
  background: var(--ink);
  color: #fff;
  font-size: 11px;
  letter-spacing: 0.04em;
}

.dev-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  margin-top: 10px;
}

.dev-box .btn-block {
  margin-top: 10px;
}

/* 넓은 화면의 왼쪽 소개 판 */
@media (width >= 960px) {
  .login-grid {
    grid-template-columns: minmax(0, 480px) minmax(0, 1fr);
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--card-edge);
    border-radius: var(--r-xl);
    background: var(--bg);
    box-shadow: var(--shadow-card);
  }

  .login .login-card {
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .login-aside {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 48px;
    background:
      radial-gradient(70% 60% at 100% 0%, rgb(18 181 161 / 18%), transparent 70%),
      linear-gradient(180deg, var(--accent-soft), var(--canvas));
    border-left: 1px solid var(--line);
  }

  .login-aside h2 {
    font-size: 30px;
    line-height: 1.3;
    letter-spacing: -0.045em;
    font-weight: 800;
  }

  .login-aside ul {
    display: grid;
    gap: 12px;
    margin-top: 24px;
    color: var(--ink-2);
    font-size: 15.5px;
  }

  .login-aside li {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .login-aside li .icon {
    width: 18px;
    height: 18px;
    color: var(--accent-ink);
    stroke-width: 2.4;
  }
}

.demo {
  margin-top: 32px;
  padding: 16px;
  border: 1px solid var(--card-edge);
  border-radius: var(--r-lg);
  background: var(--bg);
  box-shadow: var(--shadow-card);
}

.demo-tiles {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.demo-tile {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 14px 6px 8px;
  border-radius: 12px;
  background: var(--canvas);
}

.demo-tile.talk {
  box-shadow: inset 0 0 0 2px var(--accent);
}

.demo-tile i {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.demo-tile small {
  color: var(--ink-2);
  font-size: 12px;
}

.demo-pair {
  display: inline-block;
  margin: 14px 0 8px;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 750;
}

.demo-cap small {
  display: block;
  color: var(--accent-ink);
  font-size: 13px;
}

.demo-cap b {
  display: block;
  margin-top: 4px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.03em;
}

/* ───────── /consent ───────── */

.consent-flow .flow-card {
  padding: 0;
}

.consent-body {
  padding: 36px 36px 8px;
}

.progress {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink-2);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.progress .bar {
  width: 64px;
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: var(--line);
}

.progress .bar i {
  display: block;
  width: 66%;
  height: 100%;
  border-radius: 999px;
  background: var(--grad);
}

.gift {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding: 14px 16px;
  border: 1px solid var(--accent-edge);
  border-radius: var(--r-md);
  background: var(--accent-soft);
}

.gift b {
  display: block;
  color: var(--accent-ink);
  font-size: 15.5px;
}

.gift small {
  display: block;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 13.5px;
}

.gift .icon-tile {
  flex: none;
  background: var(--bg);
}

.consent-all {
  align-items: center;
  margin-top: 16px;
  padding: 16px;
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-md);
  transition: border-color 0.15s ease;
}

.consent-all:has(input:checked) {
  border-color: var(--accent);
  background: var(--live-bg);
}

.consent-all b {
  display: block;
  font-size: 16px;
}

.consent-all small {
  display: block;
  margin-top: 2px;
  color: var(--ink-2);
  font-size: 13.5px;
}

.consent-items {
  margin-top: 8px;
}

.consent-item {
  position: relative;
  border-bottom: 1px solid var(--line);
}

.consent-item:last-child {
  border-bottom: 0;
}

.consent-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 60px;
  padding: 10px 84px 10px 4px;
  cursor: pointer;
}

.consent-row .t {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 8px;
  font-size: 15.5px;
  font-weight: 650;
  line-height: 1.45;
}

.consent-more {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 2px;
  min-width: 76px;
  height: 60px;
  padding: 0 4px 0 12px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 650;
  list-style: none;
  cursor: pointer;
}

.consent-more::-webkit-details-marker {
  display: none;
}

.consent-more .icon {
  width: 16px;
  height: 16px;
  transition: transform 0.15s ease;
}

.consent-more .v-shut,
details[open] > .consent-more .v-open {
  display: none;
}

details[open] > .consent-more .v-shut {
  display: inline;
}

details[open] > .consent-more .icon {
  transform: rotate(180deg);
}

.consent-detail {
  margin: 0 0 14px 34px;
  padding: 14px 16px;
  border-radius: var(--r-sm);
  background: var(--canvas);
}

.consent-detail dl {
  display: grid;
  grid-template-columns: 6em minmax(0, 1fr);
  gap: 8px 12px;
  font-size: 13.5px;
  line-height: 1.6;
}

.consent-detail dt {
  color: var(--ink-2);
  font-weight: 700;
}

.consent-detail dd {
  color: var(--ink);
}

.consent-detail a {
  color: var(--accent-ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.consent-foot {
  position: sticky;
  bottom: 0;
  padding: 14px 36px 20px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--r-xl) var(--r-xl);
  background: rgb(255 255 255 / 94%);
  backdrop-filter: blur(8px);
}

.consent-foot p {
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

@media (width <= 559px) {
  .consent-body {
    padding: 24px 22px 8px;
  }

  .consent-foot {
    padding: 12px 22px 16px;
    border-radius: 0;
  }

  .consent-detail {
    margin-left: 0;
  }

  .consent-detail dl {
    grid-template-columns: 5.4em minmax(0, 1fr);
  }
}

/* ───────── 메일 안내·재설정·로그인 완료 ───────── */

.state .mail-addr {
  margin-top: 14px;
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
  overflow-wrap: anywhere;
}

.state .note-box {
  width: 100%;
  max-width: none;
  margin-top: 18px;
  color: var(--ink-2);
  font-size: 14.5px;
  text-align: left;
}

.state .dev-box {
  width: 100%;
  text-align: left;
}

.resend {
  display: grid;
  gap: 12px;
  width: 100%;
  margin-top: 22px;
}

.resend .help {
  text-align: center;
}

.state > .link-btn,
.back-line {
  margin-top: 8px;
}

.back-line {
  text-align: center;
}

.hint-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 24px;
  padding: 9px 14px;
  border-radius: 999px;
  background: var(--canvas);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 600;
}

.hint-pill .icon {
  width: 16px;
  height: 16px;
  color: var(--accent-ink);
}

/* 결제 결과의 기다리는 상태: 체크 대신 도는 고리 */
.state[data-state="wait"] .state-mark > span {
  position: relative;
}

.state[data-state="wait"] .state-mark .icon {
  display: none;
}

.state[data-state="wait"] .state-mark > span::after {
  content: "";
  width: 26px;
  height: 26px;
  border: 3px solid rgb(255 255 255 / 40%);
  border-top-color: #fff;
  border-radius: 50%;
}

@media (prefers-reduced-motion: no-preference) {
  .state[data-state="wait"] .state-mark > span::after {
    animation: flow-spin 0.9s linear infinite;
  }
}

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

/* ───────── 404 ───────── */

.nf {
  padding: 96px 0 112px;
}

.nf .state {
  padding-inline: 4px;
}

.nf .nf-code {
  max-width: none;
  margin-top: 0;
  font-size: clamp(88px, 18vw, 148px);
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.06em;
  background: var(--grad-text);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

.nf h1 {
  margin-top: 18px;
}

.nf .nf-mail {
  margin-top: 36px;
  font-size: 15px;
}
