/* Fancy auth — login / register / verify */

.flk-auth-page {
  overflow-y: auto;
  min-height: var(--flk-vh);
}

.flk-auth-page .page-wrap {
  min-height: var(--flk-vh);
  overflow: visible;
}

.flk-auth-page .page-wrap > footer { display: none; }
.flk-auth-page .flk-flash-stack { display: none; }
.flk-auth-page .site-main--auth {
  padding-top: var(--flk-nav-h) !important;
  min-height: var(--flk-vh) !important;
  max-width: none !important;
  overflow: visible;
}

.auth-scene {
  position: relative;
  min-height: var(--flk-fill-h);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(380px, 0.95fr);
  overflow: visible;
  background: var(--bg);
}

/* ── Visual panel ─────────────────────────────────────────────── */
.auth-visual {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 48px 56px 56px;
  overflow: hidden;
  border-right: 1px solid color-mix(in srgb, var(--text) 5%, transparent);
}

.auth-visual-aurora {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 70% 55% at 20% 15%, rgba(232, 90, 123, 0.14), transparent 55%),
    radial-gradient(ellipse 50% 45% at 85% 70%, rgba(217, 119, 6, 0.08), transparent 50%),
    radial-gradient(ellipse 40% 35% at 50% 100%, rgba(217, 56, 72, 0.08), transparent 55%);
  animation: authAurora 14s ease-in-out infinite alternate;
}

/* neon mint + violet read as stray green/purple blobs on the cream paper */
html.flk-dark .auth-visual-aurora {
  background:
    radial-gradient(ellipse 70% 55% at 20% 15%, rgba(255, 101, 132, 0.22), transparent 55%),
    radial-gradient(ellipse 50% 45% at 85% 70%, rgba(0, 245, 212, 0.12), transparent 50%),
    radial-gradient(ellipse 40% 35% at 50% 100%, rgba(124, 58, 237, 0.15), transparent 55%);
}
@keyframes authAurora {
  0%   { opacity: 0.85; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.04); }
}

.auth-visual-moon {
  position: absolute;
  top: 12%;
  right: 18%;
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f4f7ff, #c8d4e8 55%, transparent 56%);
  box-shadow: 0 0 60px rgba(200, 212, 232, 0.25);
  opacity: 0.9;
  animation: authMoonFloat 8s ease-in-out infinite;
}
@keyframes authMoonFloat {
  50% { transform: translateY(-8px); }
}

/* 한복 — women's hanbok, hanging as if on display */
.auth-hanbok {
  /* --hanbok-x carries the centring offset so the sway keyframes can reuse it */
  --hanbok-x: -50%;
  position: absolute;
  left: 50%;
  bottom: 25%;
  width: 178px;
  height: 232px;
  pointer-events: none;
  transform: translateX(var(--hanbok-x));
  transform-origin: 50% 18%;
  animation: authHanbokSway 9s ease-in-out infinite;
}
.auth-hanbok svg {
  display: block;
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 18px 34px rgba(25, 31, 74, 0.28));
}
html.flk-dark .auth-hanbok svg {
  filter: drop-shadow(0 18px 38px rgba(0, 0, 0, 0.5)) saturate(1.12) brightness(1.06);
}
/* pooled light under the hem, where the gate's glow used to sit */
.auth-hanbok::after {
  content: '';
  position: absolute;
  bottom: -14px;
  left: 50%;
  transform: translateX(-50%);
  width: 150px;
  height: 34px;
  background: radial-gradient(ellipse, rgba(99, 102, 241, 0.3), transparent 70%);
  animation: authHanbokGlow 3.4s ease-in-out infinite;
}
html.flk-dark .auth-hanbok::after {
  background: radial-gradient(ellipse, rgba(124, 58, 237, 0.42), transparent 70%);
}
@keyframes authHanbokSway {
  0%, 100% { transform: translateX(var(--hanbok-x)) rotate(-1.2deg); }
  50%      { transform: translateX(var(--hanbok-x)) rotate(1.2deg); }
}
@keyframes authHanbokGlow {
  50% { opacity: 0.6; transform: translateX(-50%) scale(1.1); }
}

.auth-hangul-orbit {
  position: absolute;
  inset: 18% 10% auto;
  height: 200px;
  pointer-events: none;
}
.auth-hangul-chip {
  position: absolute;
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 1.35rem;
  font-weight: 900;
  color: color-mix(in srgb, var(--text) 14%, transparent);
  text-shadow: 0 0 20px rgba(99, 102, 241, 0.25);
  animation: authHangulFloat 6s ease-in-out infinite;
  animation-delay: calc(var(--i) * -0.9s);
}
.auth-hangul-chip:nth-child(1) { left: 8%; top: 10%; }
.auth-hangul-chip:nth-child(2) { left: 28%; top: 55%; font-size: 1.6rem; color: color-mix(in srgb, #4f46e5 26%, transparent); }
.auth-hangul-chip:nth-child(3) { left: 52%; top: 8%; }
.auth-hangul-chip:nth-child(4) { left: 72%; top: 42%; }
.auth-hangul-chip:nth-child(5) { left: 88%; top: 18%; font-size: 1.1rem; }
.auth-hangul-chip:nth-child(6) { left: 42%; top: 78%; color: color-mix(in srgb, #f43f5e 26%, transparent); }
@keyframes authHangulFloat {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(-12px); opacity: 1; }
}

.auth-hero-avatar {
  position: relative;
  z-index: 2;
  width: fit-content;
  margin-bottom: 24px;
  padding: 10px;
  border-radius: 16px;
  background: color-mix(in srgb, var(--bg) 50%, transparent);
  border: 1px solid rgba(180, 120, 60, 0.35);
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.45), 0 0 32px rgba(180, 120, 60, 0.12);
  animation: authAvatarIn 0.8s cubic-bezier(0.34, 1.2, 0.64, 1) both;
}
.auth-hero-avatar img {
  display: block;
  width: 100px;
  height: auto;
  border-radius: 10px;
  object-fit: contain;
  object-position: center bottom;
}
.auth-hero-rank {
  display: block;
  margin-top: 8px;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--gold);
  text-align: center;
}
@keyframes authAvatarIn {
  from { opacity: 0; transform: translateY(20px) scale(0.95); }
  to   { opacity: 1; transform: none; }
}

.auth-visual-copy {
  position: relative;
  z-index: 2;
  max-width: 420px;
}
.auth-visual-eyebrow {
  font-size: 0.65rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sakura, #ff6584);
  margin: 0 0 10px;
}
.auth-visual-title {
  font-family: 'Noto Sans KR', 'Nunito', sans-serif;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 900;
  color: var(--text);
  line-height: 1.2;
  margin: 0 0 12px;
}
.auth-visual-sub {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--text3);
  margin: 0 0 22px;
}

.auth-rank-path {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
  padding: 12px 14px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  border: 1px solid color-mix(in srgb, var(--text) 8%, transparent);
  backdrop-filter: blur(8px);
}
.auth-rank-step {
  font-size: 0.62rem;
  font-weight: 700;
  color: #666;
  white-space: nowrap;
}
.auth-rank-step em {
  font-style: normal;
  font-family: 'Noto Sans KR', sans-serif;
  color: #888;
}
.auth-rank-step.is-active {
  color: var(--gold);
}
.auth-rank-step.is-active em { color: var(--gold); }
.auth-rank-step--gold { color: #d4a820; }
.auth-rank-step--gold em { color: var(--gold); }
.auth-rank-arrow {
  font-size: 0.55rem;
  color: #444;
}

.auth-sakura-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.auth-petal {
  position: absolute;
  top: -20px;
  width: 10px;
  height: 12px;
  background: radial-gradient(ellipse, #ffc0d0 0%, #ff8fab 70%, transparent 72%);
  border-radius: 50% 50% 50% 0;
  opacity: 0.75;
  animation: authPetalFall linear forwards;
}
@keyframes authPetalFall {
  to {
    transform: translateY(calc(var(--flk-vh) + 40px)) rotate(720deg);
    opacity: 0.2;
  }
}

/* ── Form panel ───────────────────────────────────────────────── */
.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px 56px;
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(255, 101, 132, 0.06), transparent),
    var(--bg);
}

.auth-card {
  position: relative;
  width: 100%;
  max-width: 400px;
  padding: 36px 32px 32px;
  border-radius: 24px;
  background: linear-gradient(165deg, var(--bg3), var(--bg));
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 101, 132, 0.06),
    inset 0 1px 0 color-mix(in srgb, var(--text) 6%, transparent);
  backdrop-filter: blur(16px);
  animation: authCardIn 0.65s cubic-bezier(0.34, 1.15, 0.64, 1) both;
}
.auth-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 24px;
  right: 24px;
  height: 2px;
  border-radius: 0 0 4px 4px;
  background: linear-gradient(90deg, var(--red, #e63946), var(--sakura, #ff6584), var(--mint, #00f5d4));
}
@keyframes authCardIn {
  from { opacity: 0; transform: translateY(24px) scale(0.97); }
  to   { opacity: 1; transform: none; }
}

.auth-card-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 5px 12px 5px 8px;
  border-radius: 100px;
  background: rgba(255, 101, 132, 0.1);
  border: 1px solid rgba(255, 101, 132, 0.25);
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sakura, #ff6584);
}
.auth-card-badge-ko {
  font-family: 'Noto Sans KR', sans-serif;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  background: linear-gradient(135deg, var(--text), var(--sakura, #ff6584));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 0;
  text-transform: none;
}

.auth-card-title {
  font-size: 1.55rem;
  font-weight: 900;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.2;
}
.auth-card-sub {
  font-size: 0.82rem;
  line-height: 1.55;
  color: #888;
  margin: 0 0 26px;
}
.auth-card-sub strong { color: var(--text); font-weight: 600; }

.auth-perks {
  display: grid;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}
.auth-perk {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text3);
}
.auth-perk-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.7rem;
  background: rgba(0, 245, 212, 0.1);
  border: 1px solid rgba(0, 245, 212, 0.2);
  flex-shrink: 0;
}
.auth-perk-icon--xp::before {
  content: '';
  width: 7px;
  height: 7px;
  background: var(--mint, #00f5d4);
  transform: rotate(45deg);
  border-radius: 1px;
  box-shadow: 0 0 6px rgba(0, 245, 212, 0.5);
}

.auth-field {
  margin-bottom: 16px;
}

.auth-gender-pick {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.auth-gender-option {
  cursor: pointer;
}

.auth-gender-input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auth-gender-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 10px 14px;
  border-radius: 14px;
  border: 2px solid color-mix(in srgb, var(--text) 10%, transparent);
  background: var(--bg3);
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}

.auth-gender-card img {
  width: 72px;
  height: 100px;
  object-fit: contain;
  object-position: bottom center;
  border-radius: 8px;
}

.auth-gender-title {
  font-size: 0.88rem;
  font-weight: 800;
  color: var(--text);
}

.auth-gender-sub {
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text3);
  letter-spacing: 0.04em;
}

.auth-gender-option.is-selected .auth-gender-card,
.auth-gender-option:has(.auth-gender-input:checked) .auth-gender-card {
  border-color: rgba(255, 101, 132, 0.65);
  box-shadow: 0 0 0 3px rgba(255, 101, 132, 0.14), 0 8px 24px rgba(0, 0, 0, 0.25);
  transform: translateY(-2px);
}

.auth-gender-option:hover .auth-gender-card {
  border-color: color-mix(in srgb, var(--text) 22%, transparent);
}
.auth-field label,
.login-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #666;
  margin-bottom: 6px;
}
.auth-input-wrap {
  position: relative;
}
.auth-input-wrap .login-input {
  width: 100%;
  padding: 12px 14px 12px 40px !important;
  border-radius: 12px !important;
  border: 1px solid color-mix(in srgb, var(--text) 10%, transparent) !important;
  background: var(--bg3) !important;
  color: var(--text) !important;
  font-size: 0.9rem !important;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s !important;
}
.auth-input-wrap .login-input:focus {
  border-color: rgba(255, 101, 132, 0.5) !important;
  box-shadow: 0 0 0 3px rgba(255, 101, 132, 0.12), 0 8px 24px rgba(0, 0, 0, 0.25) !important;
  background: var(--bg3) !important;
  outline: none !important;
}
.auth-input-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.85rem;
  opacity: 0.45;
  pointer-events: none;
}
.auth-input-wrap:focus-within .auth-input-icon { opacity: 0.85; }

.auth-card .login-btn {
  width: 100%;
  margin-top: 8px;
  padding: 14px 20px !important;
  border: none !important;
  border-radius: 12px !important;
  font-size: 0.92rem !important;
  font-weight: 800 !important;
  color: #fff !important;
  background: linear-gradient(135deg, var(--red, #e63946), var(--sakura, #ff6584)) !important;
  box-shadow: 0 8px 28px rgba(230, 57, 70, 0.4) !important;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s, box-shadow 0.2s !important;
}
.auth-card .login-btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, transparent 40%, color-mix(in srgb, var(--text) 20%, transparent) 50%, transparent 60%);
  transform: translateX(-100%);
  transition: transform 0.5s;
}
.auth-card .login-btn:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 12px 36px rgba(230, 57, 70, 0.5) !important;
}
.auth-card .login-btn:hover::after { transform: translateX(100%); }

.auth-card .login-check {
  margin: 8px 0 12px;
  font-size: 0.78rem;
}
.auth-card .login-check input {
  accent-color: var(--sakura, #ff6584);
  width: 16px;
  height: 16px;
}

.auth-card .login-err[style*="display:block"],
.auth-card .login-err[style*="display: block"] {
  margin-bottom: 14px;
  border-radius: 10px;
  font-size: 0.78rem;
}

.auth-card .login-alt {
  margin-top: 20px;
  text-align: center;
  font-size: 0.8rem;
  color: #777;
}
.auth-card .login-alt a {
  color: var(--mint, #00f5d4);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(0, 245, 212, 0.3);
  transition: color 0.2s, border-color 0.2s;
}
.auth-card .login-alt a:hover {
  color: var(--text);
  border-color: var(--mint, #00f5d4);
}
.auth-back-home {
  display: block;
  margin-top: 12px;
  text-align: center;
  font-size: 0.72rem;
  color: #555 !important;
  text-decoration: none;
}
.auth-back-home:hover { color: var(--text3) !important; }

.auth-pw-meter {
  height: 3px;
  margin-top: 8px;
  border-radius: 100px;
  background: color-mix(in srgb, var(--text) 8%, transparent);
  overflow: hidden;
}
.auth-pw-meter-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: var(--mint, #00f5d4);
  transition: width 0.25s, background 0.25s;
}

/* OTP on verify */
.auth-card .flk-otp {
  margin-bottom: 20px;
}
.auth-card .flk-otp-cell {
  border-color: color-mix(in srgb, var(--text) 12%, transparent) !important;
  background: var(--bg3) !important;
  font-size: 1.4rem !important;
}
.auth-card .flk-otp-cell:focus {
  border-color: var(--sakura, #ff6584) !important;
  box-shadow: 0 0 0 3px rgba(255, 101, 132, 0.15) !important;
}

@media (max-width: 960px) {
  .auth-scene {
    grid-template-columns: 1fr;
  }
  .auth-visual {
    min-height: 220px;
    padding: 32px 24px 28px;
    border-right: none;
    border-bottom: 1px solid color-mix(in srgb, var(--text) 6%, transparent);
  }
  /* sized down rather than scaled, and moved off the copy to the right edge */
  .auth-hanbok {
    --hanbok-x: 0;
    left: auto;
    right: 12px;
    bottom: 6%;
    width: 92px;
    height: 120px;
    opacity: 0.8;
  }
  .auth-hanbok::after { width: 78px; height: 20px; bottom: -8px; }
  .auth-visual-moon { width: 48px; height: 48px; top: 16%; right: 12%; }
  .auth-hangul-orbit { display: none; }
  .auth-hero-avatar {
    position: absolute;
    right: 20px;
    top: 24px;
    margin: 0;
    padding: 6px;
  }
  .auth-hero-avatar img { width: 64px; }
  .auth-hero-rank { font-size: 0.55rem; }
  .auth-visual-title { font-size: 1.35rem; }
  .auth-rank-path { display: none; }
  .auth-panel { padding: 28px 20px 48px; }
  .auth-card { padding: 28px 22px 24px; }
}

.auth-recaptcha-note {
  margin-top: 18px;
  font-size: 0.68rem;
  line-height: 1.45;
  color: #666;
  text-align: center;
}
.auth-recaptcha-note a {
  color: #888;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.auth-recaptcha-note a:hover { color: var(--mint, #00f5d4); }

@media (prefers-reduced-motion: reduce) {
  .auth-visual-aurora,
  .auth-visual-moon,
  .auth-hanbok,
  .auth-hanbok::after,
  .auth-hangul-chip,
  .auth-petal,
  .auth-card,
  .auth-hero-avatar { animation: none !important; }
}