:root {
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #0f172a;
  --muted: #475569;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --danger: #dc2626;
  --success: #15803d;
  --border: #cbd5e1;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(160deg, #eef2ff 0%, var(--bg) 100%);
  color: var(--text);
}

main {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

.card {
  width: min(780px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
}

h1,
h2,
h3 {
  margin-top: 0;
}

h1 {
  font-size: 1.6rem;
  margin-bottom: 0.5rem;
}

p {
  margin-top: 0.4rem;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 1rem;
}

@media (min-width: 760px) {
  .grid.two {
    grid-template-columns: 1fr 1fr;
  }
}

.panel {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1rem;
  background: #f8fafc;
}

label {
  display: block;
  font-size: 0.92rem;
  margin-bottom: 0.35rem;
  font-weight: 600;
}

input,
textarea,
button {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  font-size: 0.95rem;
  padding: 0.62rem 0.72rem;
}

textarea {
  min-height: 80px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

button {
  border: none;
  background: var(--primary);
  color: white;
  font-weight: 600;
  cursor: pointer;
}

button:hover {
  background: var(--primary-hover);
}

button.secondary {
  background: #334155;
}

button.secondary:hover {
  background: #1f2937;
}

button.danger {
  background: var(--danger);
}

button.danger:hover {
  background: #b91c1c;
}

.row {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.row > * {
  flex: 1;
  min-width: 150px;
}

.badge {
  display: inline-block;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.badge.ok {
  background: #dcfce7;
  color: #166534;
}

.badge.warn {
  background: #fee2e2;
  color: #991b1b;
}

.status {
  margin: 0.8rem 0;
  border-radius: 10px;
  padding: 0.75rem;
  font-size: 0.92rem;
  display: none;
}

.status.info {
  display: block;
  background: #dbeafe;
  color: #1e40af;
}

.status.success {
  display: block;
  background: #dcfce7;
  color: var(--success);
}

.status.error {
  display: block;
  background: #fee2e2;
  color: #991b1b;
}

.hidden {
  display: none !important;
}

.small {
  font-size: 0.85rem;
  color: var(--muted);
}

.qr-box {
  width: 220px;
  min-height: 220px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #ffffff;
  display: grid;
  place-items: center;
  padding: 0.35rem;
}

.qr-box canvas,
.qr-box img {
  max-width: 100%;
  height: auto;
}

.code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  letter-spacing: 0.02em;
}

.hero {
  text-align: center;
  padding: 1rem 0 0.4rem;
}

.success-box {
  border: 2px dashed #16a34a;
  border-radius: 14px;
  background: #f0fdf4;
  padding: 1rem;
}
