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

:root {
  --bg: #eff7f6;
  --card: #ffffff;
  --surface: #f7fbfb;
  --primary: #18a9a2;
  --primary-hover: #13928c;
  --primary-soft: #d8f2ef;
  --text: #102323;
  --text-muted: #5c7675;
  --border: #d4e6e3;
  --error: #c0392b;
  --success: #27ae60;
  --radius: 18px;
}

html {
  font-size: 16px;
}

body {
  font-family: "Noto Sans KR", -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100dvh;
  display: flex;
  justify-content: center;
  padding: 28px 16px 20px;
}

.container {
  width: 100%;
  max-width: 428px;
}

.header {
  padding: 8px 0 24px;
}

.brand-panel {
  padding: 20px 18px 18px;
  border: 1px solid var(--border);
  border-radius: 28px;
  background: var(--card);
  box-shadow: 0 6px 18px rgba(16, 35, 35, 0.06);
  text-align: center;
}

.brand-mark-wrap {
  display: inline-flex;
  padding: 8px;
  border-radius: 26px;
  background: var(--surface);
  border: 1px solid var(--border);
}

.brand-mark {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 20px;
  display: block;
}

.brand-copy {
  margin-top: 14px;
}

.brand-name {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
}

.subtitle {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--primary);
  margin-top: 4px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(16, 35, 35, 0.05);
  position: relative;
}

.card h2 {
  font-size: 1.125rem;
  font-weight: 700;
  margin-bottom: 4px;
}

.desc {
  font-size: 0.8125rem;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.step-badge {
  position: absolute;
  top: -12px;
  left: 20px;
  width: 30px;
  height: 30px;
  background: var(--primary);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  box-shadow: 0 4px 10px rgba(24, 169, 162, 0.18);
}

.field {
  margin-bottom: 16px;
  position: relative;
}

.field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text);
}

.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
  background: var(--surface);
}

.field input:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(24, 169, 162, 0.12);
}

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

.timer {
  position: absolute;
  right: 14px;
  top: 38px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--error);
  font-variant-numeric: tabular-nums;
}

.btn {
  width: 100%;
  padding: 14px;
  border: 1px solid transparent;
  border-radius: 12px;
  font-size: 0.95rem;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.18s, opacity 0.18s, border-color 0.18s, color 0.18s;
  background: var(--primary);
  color: #fff;
  margin-top: 4px;
  box-shadow: none;
}

.btn:hover {
  background: var(--primary-hover);
}

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

.btn-ghost {
  background: #ffffff;
  color: var(--text-muted);
  border-color: var(--border);
  margin-top: 8px;
}

.btn-ghost:hover {
  background: var(--primary-soft);
  color: var(--text);
}

.msg {
  font-size: 0.8125rem;
  margin-top: 12px;
  min-height: 1.2em;
  text-align: center;
}

.msg.error {
  color: var(--error);
}

.msg.success {
  color: var(--success);
}

.hidden {
  display: none;
}

.result-icon {
  width: 56px;
  height: 56px;
  background: var(--success);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto 16px;
}

.result-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin: 16px 0;
}

.result-box span {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.05em;
}

#step-result {
  text-align: center;
}

.qr-block {
  margin: 20px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.qr-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.qr-frame {
  width: 240px;
  max-width: 80%;
  aspect-ratio: 1 / 1;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.qr-frame img {
  image-rendering: pixelated;
}

.qr-help {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  max-width: 280px;
}

.footer {
  text-align: center;
  padding: 12px 0 8px;
}

.footer p {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.loading .btn {
  position: relative;
  color: transparent;
}

.loading .btn::after {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  top: 50%;
  left: 50%;
  margin: -9px 0 0 -9px;
  border: 2.5px solid rgba(255, 255, 255, 0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}

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

@media (max-width: 360px) {
  .card {
    padding: 24px 18px;
  }

  .brand-mark {
    width: 84px;
    height: 84px;
  }
}
