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

:root {
  --blue: #3B6FF0; --blue-light: #EEF2FE; --blue-mid: #C5D3FB;
  --gray: #6B7280; --text: #111827; --border: #E5E7EB; --radius: 16px;
  --success: #10B981; --error: #EF4444; --warning: #F59E0B;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #F9FAFB; color: var(--text);
  min-height: 100vh; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: 20px;
}

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

/* ── Progress ── */
.progress-wrap { margin-bottom: 24px; }
.progress-steps { display: flex; align-items: center; justify-content: center; margin-bottom: 8px; }
.step-dot {
  width: 30px; height: 30px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600; transition: all .3s ease;
  background: white; border: 2px solid var(--border); color: var(--gray); flex-shrink: 0;
}
.step-dot.active { background: var(--blue); border-color: var(--blue); color: white; }
.step-dot.done   { background: var(--success); border-color: var(--success); color: white; }
.step-line { flex: 1; height: 2px; background: var(--border); transition: background .3s ease; }
.step-line.done { background: var(--success); }
.progress-label   { text-align: center; font-size: 13px; color: var(--gray); }
.progress-section { text-align: center; font-size: 11px; color: var(--blue); font-weight: 600; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 6px; }

/* ── Card ── */
.card { background: white; border-radius: var(--radius); padding: 52px 56px; box-shadow: 0 1px 3px rgba(0,0,0,.07), 0 8px 24px rgba(0,0,0,.05); }

/* ── Logo ── */
.logo-area { display: flex; flex-direction: column; align-items: center; margin-bottom: 28px; }

/* ── Welcome ── */
.welcome-title { font-size: 32px; font-weight: 700; text-align: center; margin-bottom: 14px; line-height: 1.3; }
.welcome-sub   { text-align: center; color: var(--gray); font-size: 17px; line-height: 1.7; margin-bottom: 32px; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 36px; }
.chip  { background: var(--blue-light); color: var(--blue); border-radius: 999px; padding: 7px 16px; font-size: 14px; font-weight: 500; }
.chip-bt::before {
  content: '';
  display: inline-block; width: 10px; height: 13px;
  margin-right: 5px; vertical-align: middle;
  background-color: var(--blue);
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolyline fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' points='6.5 6.5 17.5 17.5 12 23 12 1 17.5 6.5 6.5 17.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpolyline fill='none' stroke='black' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round' points='6.5 6.5 17.5 17.5 12 23 12 1 17.5 6.5 6.5 17.5'/%3E%3C/svg%3E");
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
  -webkit-mask-size: contain; mask-size: contain;
}

/* ── Buttons ── */
.btn { width: 100%; padding: 17px; border-radius: 12px; font-size: 17px; font-weight: 600; cursor: pointer; border: none; transition: all .2s ease; }
.btn-primary { background: var(--blue); color: white; }
.btn-primary:hover    { background: #2d5edc; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(59,111,240,.3); }
.btn-primary:active   { transform: translateY(0); }
.btn-primary:disabled { background: var(--blue-mid); cursor: not-allowed; transform: none; box-shadow: none; }
.btn-ghost { background: transparent; color: var(--gray); font-size: 16px; padding: 11px; margin-top: 4px; }
.btn-ghost:hover { color: var(--text); }

/* ── Step headings ── */
.step-icon  { width: 60px; height: 60px; border-radius: 16px; background: var(--blue-light); display: flex; align-items: center; justify-content: center; font-size: 28px; margin: 0 auto 20px; }
.step-title { font-size: 24px; font-weight: 700; text-align: center; margin-bottom: 10px; }
.step-sub   { text-align: center; color: var(--gray); font-size: 16px; line-height: 1.7; margin-bottom: 28px; }

/* ── Checklist ── */
.checklist { list-style: none; margin-bottom: 28px; }
.checklist li { display: flex; align-items: flex-start; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 16px; }
.checklist li:last-child { border-bottom: none; }

/* ── Content images ── */
.content-img { width: 100%; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 16px; object-fit: cover; }

/* ── Alerts ── */
.alert { border-radius: 10px; padding: 16px 18px; font-size: 15px; line-height: 1.6; margin-bottom: 14px; }
.alert-info    { background: #EFF6FF; border: 1px solid #BFDBFE; color: #1E40AF; }
.alert-warning { background: #FFFBEB; border: 1px solid #FDE68A; color: #92400E; }
.alert strong  { font-weight: 700; }

/* ── Participant ID badge ── */
.id-badge { display: inline-block; background: var(--blue-light); border: 2px solid var(--blue-mid); border-radius: 8px; padding: 6px 16px; font-size: 24px; font-weight: 800; letter-spacing: 4px; color: var(--blue); }

/* ── Code input ── */
.code-input-wrap { display: flex; gap: 12px; justify-content: center; margin-bottom: 14px; }
.code-char { width: 76px; height: 86px; border: 2px solid var(--border); border-radius: 14px; text-align: center; font-size: 34px; font-weight: 700; color: var(--text); background: white; outline: none; transition: border-color .2s, box-shadow .2s; text-transform: uppercase; caret-color: var(--blue); }
.code-char:focus  { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(59,111,240,.15); }
.code-char.filled { border-color: var(--blue-mid); background: var(--blue-light); }
.code-hint { text-align: center; font-size: 14px; color: var(--gray); margin-bottom: 28px; }
.code-hint span { color: var(--blue); font-weight: 500; }

/* ── Pairing ── */
.pairing-box { border-radius: 12px; padding: 16px; margin-bottom: 20px; display: flex; align-items: center; gap: 14px; }
.pairing-box.searching { background: var(--blue-light); }
.pairing-box.found     { background: #ECFDF5; }
.pairing-box.error     { background: #FEF2F2; }
.pairing-text strong { display: block; font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.pairing-text span   { font-size: 14px; color: var(--gray); }
.pairing-box.error .pairing-text strong { color: var(--error); }

.spinner { width: 22px; height: 22px; border: 2.5px solid var(--blue-mid); border-top-color: var(--blue); border-radius: 50%; animation: spin .7s linear infinite; flex-shrink: 0; }
@keyframes spin { to { transform: rotate(360deg); } }

.device-pill { background: var(--blue-light); border: 1px solid var(--blue-mid); border-radius: 8px; padding: 10px 14px; font-size: 13px; font-family: monospace; color: var(--blue); text-align: center; margin-bottom: 16px; word-break: break-all; }

/* ── Passcode callout ── */
.passcode-callout { display: flex; align-items: center; gap: 14px; background: #FFFBEB; border: 1.5px solid #FDE68A; border-radius: 12px; padding: 14px 16px; margin-bottom: 16px; }
.passcode-callout .pc-text { font-size: 14px; color: #92400E; line-height: 1.5; }
.passcode-callout .pc-text strong { font-size: 16px; letter-spacing: 2px; color: #78350F; }

/* ── Modal ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 100; padding: 24px; opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.modal-overlay.visible { opacity: 1; pointer-events: all; }
.modal { background: white; border-radius: 20px; padding: 32px 28px; max-width: 400px; width: 100%; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.2); transform: translateY(10px); transition: transform .2s ease; }
.modal-overlay.visible .modal { transform: translateY(0); }
.modal-emoji  { font-size: 40px; margin-bottom: 16px; }
.modal-title  { font-size: 19px; font-weight: 700; margin-bottom: 8px; }
.modal-body   { font-size: 15px; color: var(--gray); line-height: 1.6; margin-bottom: 20px; }
.passcode-badge { display: inline-block; background: #FFFBEB; border: 2px solid #FDE68A; border-radius: 10px; padding: 10px 24px; font-size: 30px; font-weight: 800; letter-spacing: 6px; color: #78350F; margin-bottom: 20px; }

/* ── Success ── */
.success-icon { width: 72px; height: 72px; background: #ECFDF5; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 34px; margin: 0 auto 20px; }

/* ── Loading ── */
.screen-loading { text-align: center; padding: 40px 0; color: var(--gray); font-size: 15px; }

.divider { height: 1px; background: var(--border); margin: 18px 0; }

/* ── Mobile tweaks (≤ 480px) ── */
@media (max-width: 480px) {
  body { padding: 12px; justify-content: flex-start; padding-top: 24px; }
  .card { padding: 28px 20px; border-radius: 14px; }
  .progress-wrap { margin-bottom: 18px; }
  .welcome-title { font-size: 22px; }
  .welcome-sub   { font-size: 14px; }
  .step-title    { font-size: 19px; }
  .step-sub      { font-size: 14px; }
  .btn           { padding: 14px; font-size: 15px; }
  .code-char     { width: 56px; height: 64px; font-size: 24px; }
  .code-input-wrap { gap: 8px; }
  .checklist li  { font-size: 14px; }
  .alert         { font-size: 13px; padding: 12px 14px; }
  .chip          { font-size: 12px; padding: 5px 11px; }
  .step-dot      { width: 26px; height: 26px; font-size: 11px; }
}