:root {
  color-scheme: light;
  --ink: #222529;
  --muted: #66706f;
  --line: #d9dfd9;
  --surface: #ffffff;
  --wash: #f6f8f4;
  --forest: #176b58;
  --forest-dark: #104d3f;
  --accent: #ff481f;
  --accent-soft: #fff3e9;
  --good: #2f7d59;
  --danger: #bd2a2a;
  --shadow: 0 18px 60px rgba(35, 42, 36, 0.12);
  font-family: Pretendard, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.88) 0, rgba(246, 248, 244, 0.96) 360px),
    var(--wash);
  color: var(--ink);
}

body.is-sheet-open {
  overflow: hidden;
}

body,
button,
input {
  font: inherit;
}

button,
input {
  letter-spacing: 0;
}

button {
  border: 0;
  cursor: pointer;
}

img,
svg {
  display: block;
}

[hidden] {
  display: none !important;
}

.auth-app {
  width: min(100%, 430px);
  min-height: 100vh;
  margin: 0 auto;
  background: var(--surface);
  box-shadow: 0 0 0 1px rgba(217, 223, 217, 0.52);
  position: relative;
  overflow-x: hidden;
}

.auth-topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  height: 56px;
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 12px;
  padding: 0 10px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(14px);
}

.auth-topbar h1 {
  margin: 0;
  font-size: 17px;
  font-weight: 800;
  text-align: center;
}

.icon-button {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: var(--ink);
  padding: 0;
}

.icon-button svg {
  width: 24px;
  height: 24px;
  fill: currentColor;
}

.icon-button:hover {
  background: var(--wash);
}

.auth-page {
  min-height: calc(100vh - 56px);
  display: flex;
  flex-direction: column;
  padding: 24px 18px 40px;
}

.brand-strip {
  min-height: 42px;
  display: flex;
  align-items: center;
  margin-bottom: 18px;
}

.auth-logo {
  width: 154px;
  height: auto;
}

.auth-copy {
  padding: 8px 0 28px;
}

.auth-eyebrow {
  margin: 0 0 10px;
  color: var(--forest);
  font-size: 13px;
  font-weight: 850;
}

.auth-copy h2 {
  margin: 0 0 10px;
  font-size: 28px;
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: 0;
}

.auth-copy p:not(.auth-eyebrow) {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.auth-step {
  display: grid;
  gap: 12px;
}

.field-label {
  display: block;
  color: var(--ink);
  font-size: 14px;
  font-weight: 820;
}

.field-hint {
  margin: -4px 0 2px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.auth-input {
  width: 100%;
  height: 56px;
  padding: 0 14px;
  border: 1px solid #dfe6e1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: 0;
  font-size: 20px;
  font-weight: 820;
}

.auth-input::placeholder {
  color: #a7b1ac;
  font-size: 17px;
  font-weight: 650;
}

.auth-input:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(23, 107, 88, 0.13);
}

.terms-panel {
  margin-top: 6px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.terms-row {
  min-height: 46px;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 0 2px;
  color: var(--muted);
  font-size: 14px;
}

.terms-row-with-action {
  grid-template-columns: 1fr 34px;
  padding-right: 0;
}

.terms-check {
  min-width: 0;
  width: 100%;
  display: grid;
  grid-template-columns: 24px 1fr auto;
  gap: 10px;
  align-items: center;
}

.terms-row + .terms-row {
  border-top: 1px solid var(--line);
}

.terms-row input,
.terms-check input {
  width: 20px;
  height: 20px;
  accent-color: var(--forest);
}

.terms-row span,
.terms-check span {
  min-width: 0;
}

.terms-row em,
.terms-check em {
  justify-self: end;
  margin-left: auto;
  color: #9aa7a1;
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
  white-space: nowrap;
}

.terms-all {
  color: var(--ink);
  font-weight: 850;
}

.term-detail-button {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  color: #8a9690;
  padding: 0;
}

.term-detail-button svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.term-detail-button:hover {
  background: var(--wash);
  color: var(--forest);
}

.auth-button {
  min-height: 52px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--forest);
  color: #fff;
  font-size: 15px;
  font-weight: 850;
  transition: transform 0.16s ease, background 0.16s ease;
}

.auth-button:hover {
  background: var(--forest-dark);
}

.auth-button:active {
  transform: translateY(1px);
}

.auth-button.is-disabled,
.auth-button:disabled {
  background: #c9d2cc;
  cursor: not-allowed;
}

.otp-step {
  gap: 14px;
}

.otp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 0 4px;
}

.otp-head .field-hint {
  margin: 0 0 4px;
}

.otp-head strong {
  font-size: 18px;
  line-height: 1.3;
}

.text-button {
  min-height: 34px;
  padding: 0;
  background: transparent;
  color: var(--forest);
  font-size: 13px;
  font-weight: 850;
}

.text-button:disabled {
  color: #aeb8b2;
  cursor: not-allowed;
}

.otp-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.otp-boxes {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
  padding: 0;
  background: transparent;
}

.otp-boxes span {
  height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid #dfe6e1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.otp-boxes.is-focused span {
  border-color: #c5d6cc;
}

.otp-boxes span.is-active {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(23, 107, 88, 0.13);
}

.otp-meta {
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--danger);
  font-size: 13px;
  font-weight: 850;
}

.auth-message {
  min-height: 38px;
  margin: 18px 0 0;
  padding: 11px 12px;
  border-radius: 8px;
  background: var(--wash);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.auth-message.good {
  background: #eaf5ef;
  color: var(--good);
}

.auth-message.warn {
  background: var(--accent-soft);
  color: #8a4a25;
}

.auth-message.danger {
  background: #fff5f4;
  color: var(--danger);
}

.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(17, 24, 21, 0.46);
}

.terms-sheet {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 50;
  width: min(100%, 430px);
  max-height: min(78vh, 640px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  transform: translateX(-50%);
  border-radius: 18px 18px 0 0;
  background: #fff;
  box-shadow: 0 -16px 48px rgba(15, 24, 22, 0.2);
  overflow: hidden;
}

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

.sheet-header {
  display: grid;
  grid-template-columns: 1fr 42px;
  gap: 14px;
  align-items: start;
  padding: 12px 18px 14px;
  border-bottom: 1px solid var(--line);
}

.sheet-header p {
  margin: 0 0 4px;
  color: var(--forest);
  font-size: 12px;
  font-weight: 850;
}

.sheet-header h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.3;
  font-weight: 900;
}

.sheet-close {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--forest);
  padding: 0;
}

.sheet-close svg {
  width: 20px;
  height: 20px;
  fill: currentColor;
}

.sheet-content {
  overflow: auto;
  padding: 16px 18px 18px;
  color: #39423e;
}

.sheet-content h3 {
  margin: 16px 0 8px;
  font-size: 15px;
  line-height: 1.35;
}

.sheet-content h3:first-child {
  margin-top: 0;
}

.sheet-content p,
.sheet-content li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.62;
}

.sheet-content p {
  margin: 0 0 10px;
}

.sheet-content ul {
  display: grid;
  gap: 6px;
  margin: 0 0 12px;
  padding-left: 18px;
}

.sheet-confirm {
  min-height: 52px;
  margin: 0 18px 18px;
  border-radius: 8px;
  background: var(--forest);
  color: #fff;
  font-size: 15px;
  font-weight: 850;
}

@media (min-width: 760px) {
  body {
    padding: 28px 0;
  }

  .auth-app {
    min-height: calc(100vh - 56px);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow);
  }
}
