:root {
  --outer-dark: #141619;
  --brand-blue: #0070ff;
  --brand-blue-deep: #005ce0;
  --kakao: #fee500;
  --kakao-ink: #191919;
  --naver: #03c75a;
  --ink: #111827;
  --muted-dark: #64748b;
  --ok-green: #0f9d58;
  --ease-sheet: cubic-bezier(0.22, 1, 0.36, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
  background: var(--outer-dark);
  color: #ffffff;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
}

html.is-policy-open,
body.is-policy-open {
  overflow: hidden !important;
  overscroll-behavior: none !important;
}

body {
  display: flex;
  justify-content: center;
  min-height: 100dvh;
  background: var(--outer-dark);
}

.login-column {
  width: 100%;
  max-width: 560px;
  min-height: 100dvh;
  background: linear-gradient(180deg, #0078ff 0%, #0066f0 55%, #0058db 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  padding: 56px 24px 34px;
  position: relative;
  overflow: hidden;
}

/* Subtle dark scrim above sheet so sheet pops cleanly and backdrop click dismisses */
.sheet-scrim {
  position: absolute;
  inset: 0;
  z-index: 6;
  background: rgba(0, 18, 56, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.34s ease, visibility 0.34s ease;
}
.login-column.is-sheet-open .sheet-scrim {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.sheet-back-btn {
  position: absolute;
  top: 18px;
  left: 18px;
  z-index: 12;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-family: inherit;
  font-size: 14px;
  font-weight: 650;
  padding: 6px 4px;
  cursor: pointer;
  opacity: 0;
  transform: translateX(-8px);
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.26s ease, transform 0.32s var(--ease-sheet), visibility 0.26s ease;
}
.sheet-back-btn:hover { color: #ffffff; }
.sheet-back-btn svg { width: 18px; height: 18px; }
.login-column.is-sheet-open .sheet-back-btn {
  opacity: 1;
  transform: translateX(0);
  visibility: visible;
  pointer-events: auto;
}

.brand-hero {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 20px;
  padding-bottom: 16px;
  text-align: center;
  position: relative;
  z-index: 7;
  pointer-events: auto;
  transform: translateY(0) scale(1);
  transition: transform 0.4s var(--ease-sheet);
  will-change: transform;
}

.login-column.is-sheet-open .brand-hero {
  transform: translateY(-76px) scale(0.84);
  pointer-events: none;
}
.login-column.is-sheet-open .brand-home-link {
  pointer-events: auto;
}

.brand-home-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #ffffff;
}

.brand-mark-wrap {
  width: 92px;
  height: 92px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 16px 36px rgba(0, 32, 92, 0.24);
  margin-bottom: 16px;
}

.brand-mark-wrap img {
  width: 74px;
  height: 74px;
  object-fit: contain;
  display: block;
}

.brand-wordmark {
  margin: 0;
  font-size: 32px;
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #ffffff;
  line-height: 1.1;
}

/* Default 4-circle auth picker — fades out softly as sheet slides up */
.auth-block {
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin-bottom: 34px;
  position: relative;
  z-index: 4;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.24s ease, transform 0.32s var(--ease-sheet);
}
.login-column.is-sheet-open .auth-block {
  opacity: 0;
  transform: translateY(20px);
  pointer-events: none;
}

.auth-caption {
  margin: 0 0 38px;
  font-size: 13.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.9);
  letter-spacing: -0.01em;
}

.circle-row {
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 18px;
}

.circle-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
  color: #ffffff;
  width: 68px;
  outline: none;
  text-decoration: none;
}

.circle-orb {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  box-shadow: 0 8px 20px rgba(0, 26, 78, 0.22);
}

.circle-btn:not(.is-disabled):hover .circle-orb { transform: translateY(-2px); }
.circle-btn:not(.is-disabled):active .circle-orb { transform: scale(0.95); }
.circle-btn:focus-visible .circle-orb {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.8), 0 8px 20px rgba(0, 26, 78, 0.24);
}

.circle-orb--kakao { background: var(--kakao); color: var(--kakao-ink); }
.circle-orb--kakao svg { width: 24px; height: 24px; }

.circle-orb--naver { background: var(--naver); color: #ffffff; }
.circle-orb--naver svg { width: 20px; height: 20px; }

.circle-orb--google { background: #ffffff; }
.circle-orb--google svg { width: 22px; height: 22px; }

.circle-orb--site { background: #141a24; color: #ffffff; }
.circle-orb--site svg { width: 22px; height: 22px; }

.circle-label {
  font-size: 12.5px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.circle-btn.is-disabled { cursor: not-allowed; }
.circle-btn.is-disabled .circle-orb {
  opacity: 0.56;
  filter: saturate(0.75);
  box-shadow: 0 4px 12px rgba(0, 26, 78, 0.14);
}
.circle-btn.is-disabled .circle-label { color: rgba(255, 255, 255, 0.65); }

.soon-tooltip {
  position: absolute;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  background: #141619;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  padding: 8px 11px;
  border-radius: 8px;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.28);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s ease;
  z-index: 20;
}
.soon-tooltip::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #141619;
}

.circle-btn.is-disabled:hover .soon-tooltip,
.circle-btn.is-disabled:focus-visible .soon-tooltip,
.circle-btn.is-disabled.is-tip-open .soon-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.auth-divider {
  width: 248px;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0 18px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}
.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: rgba(255, 255, 255, 0.34);
}

.sub-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.84);
}
.sub-links button,
.sub-links a {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  color: #ffffff;
  text-decoration: none;
  cursor: pointer;
}
.sub-links button:hover,
.sub-links a:hover { text-decoration: underline; }

.join-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.login-footer {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.72);
  position: relative;
  z-index: 4;
  transition: opacity 0.2s ease;
}
.login-column.is-sheet-open .login-footer {
  opacity: 0;
  pointer-events: none;
}
.footer-links {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.footer-links button {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 600;
  cursor: pointer;
}
.footer-links button:hover { text-decoration: underline; }
.footer-copy {
  margin: 0;
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.62);
}

/* ================================================================
   Silky Native Slide-Up Bottom Sheet (from bottom edge 104% -> 0%)
   ================================================================ */
.auth-sheet {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 15;
  width: 100%;
  max-height: 82dvh;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: #ffffff;
  color: var(--ink);
  border-radius: 30px 30px 0 0;
  padding: 26px 28px 34px;
  box-shadow: 0 -14px 44px rgba(0, 18, 56, 0.24);
  transform: translate3d(0, 104%, 0);
  visibility: hidden;
  pointer-events: none;
  will-change: transform;
  transition: transform 0.42s var(--ease-sheet), visibility 0.42s;
}

.login-column.is-sheet-open .auth-sheet {
  transform: translate3d(0, 0, 0);
  visibility: visible;
  pointer-events: auto;
}

.sheet-inner {
  max-width: 390px;
  margin: 0 auto;
}

.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 999px;
  background: #e2e8f0;
  margin: -10px auto 22px;
}

.sheet-title-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 22px;
}

.sheet-title {
  margin: 0;
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.sheet-mode-switch {
  border: 0;
  background: transparent;
  color: var(--brand-blue);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 750;
  padding: 4px 2px;
  cursor: pointer;
}
.sheet-mode-switch:hover { text-decoration: underline; }

.sheet-form {
  display: grid;
  gap: 12px;
}

.input-row {
  position: relative;
  display: flex;
  align-items: center;
}
.input-row[hidden] { display: none; }

.input-row input {
  width: 100%;
  height: 52px;
  padding: 0 16px;
  border-radius: 14px;
  border: 1.5px solid transparent;
  background: #f2f5f9;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  outline: none;
  transition: background 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}
.input-row input::placeholder {
  color: #8b95a5;
  font-weight: 450;
}
.input-row input:focus {
  background: #ffffff;
  border-color: var(--brand-blue);
  box-shadow: 0 0 0 3.5px rgba(0, 112, 255, 0.12);
}
.input-row input:read-only {
  background: #eef6ff;
  border-color: #c9e0ff;
  color: #1e3a5f;
}

.input-row.has-action input { padding-right: 98px; }
.input-row.has-pw input { padding-right: 58px; }

.inline-action-btn {
  position: absolute;
  right: 8px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  background: #e6f0ff;
  color: var(--brand-blue);
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.inline-action-btn:hover { background: #d6e7ff; }
.inline-action-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.inline-action-btn.is-verified {
  background: #e7f8ef;
  color: var(--ok-green);
  cursor: default;
  opacity: 1;
}
.inline-action-btn[hidden] { display: none; }

.pw-toggle {
  position: absolute;
  right: 10px;
  border: 0;
  background: transparent;
  color: #8b95a5;
  font-family: inherit;
  font-size: 12.5px;
  font-weight: 650;
  padding: 6px 8px;
  cursor: pointer;
}
.pw-toggle:hover { color: var(--ink); }

.verify-note {
  margin: -3px 2px 0;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--brand-blue);
  line-height: 1.45;
}
.verify-note.is-ok { color: var(--ok-green); }
.verify-note:empty { display: none; }

.form-error {
  margin: 0 2px;
  font-size: 12.5px;
  font-weight: 600;
  color: #dc2626;
  line-height: 1.45;
}
.form-error:empty { display: none; }

.submit-btn {
  margin-top: 8px;
  width: 100%;
  height: 54px;
  border: 0;
  border-radius: 15px;
  background: var(--brand-blue);
  color: #ffffff;
  font-family: inherit;
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
  cursor: pointer;
  transition: background 0.15s ease, opacity 0.15s ease;
}
.submit-btn:hover { background: var(--brand-blue-deep); }
.submit-btn:disabled { opacity: 0.6; cursor: wait; }

.sheet-footer {
  margin-top: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #94a3b8;
}
.sheet-footer button {
  border: 0;
  background: transparent;
  padding: 0;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
}
.sheet-footer button:hover { color: var(--ink); text-decoration: underline; }

/* Policy modal */
.policy-shade {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 14, 24, 0.56);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  overflow: hidden;
  overscroll-behavior: contain;
  touch-action: none;
}
.policy-shade[hidden] { display: none; }

.policy-dialog {
  width: 100%;
  max-width: 560px;
  max-height: 86dvh;
  background: #ffffff;
  color: var(--ink);
  border-radius: 18px;
  display: flex;
  flex-direction: column;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.34);
  overflow: hidden;
}
.policy-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #e5eaf2;
  flex-shrink: 0;
}
.policy-head h2 { margin: 0; font-size: 17px; font-weight: 800; color: var(--ink); }
.policy-close {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #475569;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}
.policy-close:hover { background: #f1f5f9; }
.policy-close svg { width: 18px; height: 18px; }
.policy-body {
  padding: 18px 20px 24px;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-y;
  font-size: 13.5px;
  line-height: 1.72;
  color: #334155;
}
.policy-body h3 { margin: 18px 0 6px; font-size: 14.5px; color: var(--ink); }
.policy-body section:first-child h3 { margin-top: 0; }
.policy-body p, .policy-body ol { margin: 0 0 10px; }
.policy-body ol { padding-left: 18px; }
.policy-body table { width: 100%; border-collapse: collapse; margin: 10px 0; font-size: 12.5px; }
.policy-body th, .policy-body td { border: 1px solid #e2e8f0; padding: 8px 10px; text-align: left; vertical-align: top; }
.policy-body th { background: #f8fafc; font-weight: 700; color: var(--ink); }
.policy-body .policy-table-wrap { overflow-x: auto; }
.policy-body button { display: none; }

@media (max-width: 560px) {
  .login-column { max-width: 100%; padding: 36px 18px 28px; }
  .auth-sheet { padding: 24px 20px 30px; border-radius: 26px 26px 0 0; }
  .circle-row { gap: 12px; }
  .circle-btn { width: 64px; }
  .circle-orb { width: 50px; height: 50px; }
}

@media (max-height: 700px) {
  .login-column.is-sheet-open .brand-hero {
    transform: translateY(-96px) scale(0.74);
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-sheet, .brand-hero, .auth-block, .sheet-scrim, .sheet-back-btn {
    transition-duration: 0.01ms !important;
  }
}
