:root {
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #5c6570;
  --accent: #1d4ed8;
  --accent-disabled: #93c5fd;
  --danger: #b91c1c;
  --border: #d8dde3;
  --section: #eef1f4;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}
main {
  max-width: 560px;
  margin: 0 auto;
  padding: 16px;
  min-height: 100vh;
}
.status {
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 10px;
}
.status.error { color: var(--danger); }
.status:empty { display: none; }

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px 16px;
  margin: 0 auto;
  max-width: 560px;
}
h1 {
  margin: 0 0 8px;
  font-size: 1.35rem;
  font-weight: 700;
  text-align: center;
}
.trial-note {
  margin: 0 0 16px;
  text-align: center;
  font-size: 0.8rem;
  color: var(--muted);
}
.section-heading {
  margin: 20px 0 8px;
  padding: 8px 10px;
  background: var(--section);
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 650;
}
.field {
  margin-bottom: 14px;
}
label {
  display: block;
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}
input, textarea, select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 1rem;
}
textarea { min-height: 88px; resize: vertical; }
.field-error {
  color: var(--danger);
  font-size: 0.8rem;
  margin-top: 4px;
  min-height: 1.1em;
}
.hint {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 4px 0 0;
}
button.primary {
  appearance: none;
  border: 0;
  border-radius: 10px;
  width: 100%;
  min-height: 48px;
  padding: 12px 16px;
  font-weight: 650;
  font-size: 1rem;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}
button.primary:disabled {
  background: var(--accent-disabled);
  cursor: not-allowed;
}
button.secondary {
  appearance: none;
  border: 1px solid var(--border);
  border-radius: 10px;
  width: 100%;
  min-height: 44px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  background: #fff;
  color: var(--text);
  margin-bottom: 10px;
}
.actions {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
button.linkish {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 0.88rem;
  padding: 8px 0;
  cursor: pointer;
  min-height: 44px;
}
.repeat-item {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
}
.repeat-item input { flex: 1; }
.repeat-item-stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
}
.repeat-item-controls {
  display: flex;
  gap: 8px;
  align-items: center;
}
.repeat-item-controls input { flex: 1; }
.repeat-label {
  font-size: 0.82rem;
  color: var(--muted);
  font-weight: 600;
}
.repeat-box { margin-top: 4px; }

/* Result: hanya QR + countdown, tengah layar */
.qr-result-screen {
  min-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  padding: 16px;
}
.qr-countdown {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
  text-align: center;
}
.qr-wrap {
  background: #ffffff;
  padding: 0;
  border-radius: 0;
  display: block;
  margin: 0 auto;
  width: min(260px, calc(100vw - 64px));
  max-width: 260px;
  aspect-ratio: 1 / 1;
  line-height: 0;
  overflow: hidden;
}
.qr-wrap .qr-reply-svg,
.qr-wrap svg {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 260px;
  aspect-ratio: 1 / 1;
  shape-rendering: crispEdges;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
}
.qr-wrap img { display: none; }

.error-card h2 { margin: 0 0 8px; font-size: 1.15rem; }
.error-card .error { color: var(--danger); margin: 0; }
