:root {
  --bg: #0f1420;
  --panel: #171d2b;
  --panel-2: #1e2536;
  --border: #2a3348;
  --text: #e7ecf5;
  --muted: #8b96ab;
  --accent: #4f8cff;
  --accent-2: #2fbf85;
  --danger: #ff5d5d;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

#app {
  width: 100%;
  min-height: 100dvh;
  position: relative;
}

.screen {
  display: none;
  min-height: 100dvh;
  flex-direction: column;
  padding: 28px 20px 40px;
}
.screen.active { display: flex; }

.center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 14px;
  max-width: 420px;
  margin: 0 auto;
}

h1 { font-size: 28px; margin: 0; }
h2 { font-size: 20px; margin: 0 0 16px; }
.subtitle { font-size: 16px; color: var(--muted); margin: 0; line-height: 1.5; }
.subtitle.small { font-size: 13px; }

.spinner {
  width: 40px; height: 40px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.badge-icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; font-weight: 700;
}

.checkmark {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--accent-2);
  color: #08150e;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px; font-weight: 700;
}
.checkmark.error { background: var(--danger); color: #2a0808; }

.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 20px;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  text-decoration: none;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:active { transform: scale(0.98); }
.btn-secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-secondary:active { transform: scale(0.98); }
.btn-full { width: 100%; }

.form-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 480px;
  width: 100%;
  margin: 0 auto;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  max-width: 480px;
  width: 100%;
  margin: 16px auto 0;
}
.field-group label {
  font-size: 14px;
  color: var(--muted);
}
.required-star { color: var(--danger); margin-left: 4px; }
.hint-inline { color: var(--muted); font-weight: 400; }

.field-group input,
.field-group select {
  padding: 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
}
.field-group.invalid input,
.field-group.invalid select { border-color: var(--danger); }
.field-error {
  display: none;
  color: var(--danger);
  font-size: 13px;
  margin: 0;
}
.field-group.invalid .field-error { display: block; }

.form-error {
  display: none;
  max-width: 480px;
  margin: 8px auto 0;
  text-align: center;
}
.form-error.visible { display: block; }

#screen-form #form-submit-btn { max-width: 480px; margin: 24px auto 0; width: 100%; }

.photo-picker { display: flex; flex-direction: column; align-items: center; gap: 10px; }
.photo-picker-label { position: relative; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap;
}
#photo-preview {
  width: 140px; height: 140px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--border);
}

.qr-wrap {
  background: #fff;
  padding: 16px;
  border-radius: 16px;
}
.qr-wrap img { display: block; width: 220px; height: 220px; }

.hidden { display: none !important; }
