:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #0a0a0a;
  --muted: #666;
  --border: #e5e7eb;
  --primary: #0a0a0a;
  --primary-text: #ffffff;
  --secondary: #f1f3f5;
  --ok: #0a7a3b;
  --err: #b42318;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Pretendard",
    "Noto Sans KR", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.5;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}

.card {
  width: 100%;
  max-width: 480px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.brand { text-align: center; margin-bottom: 24px; }
.logo {
  height: 28px;
  width: auto;
  image-rendering: -webkit-optimize-contrast;
}
.brand h1 {
  font-size: 22px;
  font-weight: 800;
  margin: 14px 0 8px;
}
.brand .lead {
  font-size: 14px;
  color: var(--muted);
  margin: 0;
}

.guide, .form-section { margin-top: 24px; }

.guide h2, .form-section h2 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 8px;
}
.guide p {
  font-size: 13px;
  color: var(--muted);
  margin: 0 0 12px;
}

.btn {
  display: inline-block;
  width: 100%;
  text-align: center;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
  text-decoration: none;
  transition: opacity .15s ease, transform .05s ease;
}
.btn:active { transform: scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-primary {
  background: var(--primary);
  color: var(--primary-text);
}
.btn-primary:hover { opacity: 0.92; }

.btn-secondary {
  background: var(--secondary);
  color: var(--text);
  border-color: var(--border);
}
.btn-secondary:hover { background: #e9ecef; }

form { display: flex; flex-direction: column; gap: 12px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); }
label span { font-weight: 600; color: var(--text); }
input {
  font-size: 15px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-family: inherit;
  outline: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10, 10, 10, 0.08);
}

.msg { font-size: 13px; margin: 4px 0 0; min-height: 18px; }
.msg.ok { color: var(--ok); }
.msg.err { color: var(--err); }

.foot {
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  text-align: center;
}
.foot small { color: var(--muted); font-size: 12px; }

@media (max-width: 380px) {
  .card { padding: 24px 18px; }
  .brand h1 { font-size: 20px; }
}

/* ===== Language toggle ===== */
.lang-toggle {
  display: inline-flex;
  gap: 0;
  margin: 12px 0 4px;
  padding: 3px;
  background: var(--secondary);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.lang-btn {
  appearance: none;
  background: transparent;
  color: var(--muted);
  border: none;
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s ease, color .15s ease;
}
.lang-btn:hover { color: var(--text); }
.lang-btn.active {
  background: var(--primary);
  color: var(--primary-text);
}

/* ===== Guide page ===== */
.guide-body {
  align-items: flex-start;
}
.guide-card {
  width: 100%;
  max-width: 880px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 28px 32px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
  margin: 16px auto;
}
.guide-card .brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  text-align: left;
  margin-bottom: 8px;
}
.guide-card .brand .lang-toggle { margin: 0; }
.logo-link { display: inline-flex; }

.guide-title {
  font-size: 26px;
  font-weight: 800;
  margin: 20px 0 8px;
}

.step-group { margin-top: 8px; }
.step-h2 {
  font-size: 18px;
  font-weight: 800;
  margin: 28px 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--border);
}
.step-h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 24px 0 10px;
  color: var(--text);
}
.step-p { font-size: 14px; color: var(--muted); margin: 0 0 12px; }
.external-link {
  color: var(--text);
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-all;
}

.screens {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 16px;
  margin: 8px 0 4px;
}
.screen {
  margin: 0;
  background: #fafbfc;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.screen img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  background: #000;
}
.screen.large {
  grid-column: span 2;
}
.screen figcaption {
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
  text-align: left;
  word-break: keep-all;
}

.cta {
  margin-top: 28px;
  text-align: center;
}

@media (max-width: 640px) {
  .guide-card { padding: 22px 18px 28px; margin: 8px auto; }
  .guide-title { font-size: 22px; }
  .screens { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .screen.large { grid-column: span 2; }
  .screen { padding: 8px; }
  .screen figcaption { font-size: 12px; }
}

@media (max-width: 380px) {
  .screens { grid-template-columns: 1fr; }
  .screen.large { grid-column: span 1; }
}
