*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --brand: #0a7c5e;
  --brand-dark: #085f48;
  --brand-light: #e8f5f0;
  --error: #c0392b;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --border: #d1d5db;
  --bg: #f3f4f6;
  --white: #ffffff;
  --radius: 12px;
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
}

html, body {
  height: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Apple SD Gothic Neo",
    "Noto Sans KR", "Malgun Gothic", sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout ── */
.site-header {
  background: var(--white);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.site-header__logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}

.site-header__brand {
  font-size: 17px;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.3px;
}

.site-header__sep {
  color: var(--border);
  font-weight: 300;
}

.site-header__subtitle {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 400;
}

main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px 16px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
}

.card__icon {
  width: 52px;
  height: 52px;
  background: var(--brand-light);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}

.card__icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--brand);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.card__title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  margin-bottom: 6px;
}

.card__desc {
  font-size: 13.5px;
  color: var(--text-muted);
  text-align: center;
  margin-bottom: 28px;
  line-height: 1.6;
}

.card__desc strong {
  color: var(--brand-dark);
  font-weight: 600;
}

/* ── Form ── */
.field {
  margin-bottom: 16px;
}

.field label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.field input {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  padding: 0 14px;
  font-size: 15px;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.15s, box-shadow 0.15s;
  outline: none;
  -webkit-appearance: none;
}

.field input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(10, 124, 94, 0.12);
}

.field input::placeholder {
  color: #b0b7c0;
}

/* 6-digit OTP input */
.field input[type="text"].otp-input {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: 8px;
  text-align: center;
  height: 56px;
}

/* ── Button ── */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s, opacity 0.15s;
  -webkit-appearance: none;
}

.btn-primary {
  background: var(--brand);
  color: var(--white);
  margin-top: 8px;
}

.btn-primary:hover:not(:disabled) {
  background: var(--brand-dark);
}

.btn-primary:active:not(:disabled) {
  transform: scale(0.98);
}

.btn-primary:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary .spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255,255,255,0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.btn-primary.loading .spinner {
  display: block;
}

.btn-primary.loading .btn-label {
  opacity: 0.7;
}

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

/* ── Feedback ── */
.msg {
  display: none;
  font-size: 13.5px;
  border-radius: 7px;
  padding: 10px 13px;
  margin-top: 14px;
  line-height: 1.5;
}

.msg.error {
  display: block;
  background: #fef2f2;
  color: var(--error);
  border: 1px solid #fecaca;
}

.msg.success {
  display: block;
  background: var(--brand-light);
  color: var(--brand-dark);
  border: 1px solid #a7d8c8;
}

/* ── Resend row ── */
.resend-row {
  margin-top: 18px;
  text-align: center;
  font-size: 13.5px;
  color: var(--text-muted);
}

.resend-btn {
  background: none;
  border: none;
  color: var(--brand);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.resend-btn:disabled {
  color: var(--text-muted);
  text-decoration: none;
  cursor: default;
}

.countdown {
  font-variant-numeric: tabular-nums;
}

/* ── Footer ── */
.site-footer {
  text-align: center;
  padding: 18px;
  font-size: 12.5px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  background: var(--white);
}

/* ── Step visibility ── */
.step { display: none; }
.step.active { display: block; }

/* ── Responsive ── */
@media (max-width: 440px) {
  .card {
    padding: 32px 22px;
    border-radius: 0;
    box-shadow: none;
    min-height: calc(100vh - 56px - 48px);
  }

  main {
    padding: 0;
    align-items: flex-start;
  }
}
