/* QRTool – minimal, used-only CSS, styled like PassGen */
:root {
  --app-max-width: 1400px;
  --page-bg: radial-gradient(circle at 15% 15%, #fff 0%, #f4f6fb 46%, #e2e8f0 85%);
  --surface: #fff;
  --surface-muted: #f8fafc;
  --border-soft: rgba(15, 23, 42, 0.06);
  --border-subtle: rgba(15, 23, 42, 0.025);
  --border-faint: rgba(15, 23, 42, 0.02);
  --primary: #2563eb;
  --text: #0f172a;
  --text-muted: #64748b;
  --radius-lg: 22px;
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.07);
  --focus-ring: 0 0 0 3px rgba(37, 99, 235, 0.11);
}

*,
*::before,
*::after { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  padding-bottom: 1.7rem;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--page-bg);
  color: var(--text);
}

code { font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace; font-size: 0.6rem; }

.visually-hidden {
  position: absolute !important;
  height: 1px; width: 1px;
  overflow: hidden; clip: rect(1px, 1px, 1px);
  white-space: nowrap;
}

.app-warning,
.topbar,
.container,
footer,
.footer-notice {
  width: min(var(--app-max-width), 96vw);
  margin: 0 auto;
}

.topbar {
  margin: 1.35rem auto 0.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
}
.topbar-title { display: flex; gap: 0.65rem; align-items: center; }
.topbar h1 { margin: 0; font-size: clamp(1.3rem, 3.3vw, 1.7rem); }
.topbar small { color: var(--text-muted); font-size: 0.68rem; }
.topbar-nav { display: flex; gap: 0.4rem; }
.topbar-link {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.28rem 0.7rem 0.33rem;
  font-size: 0.68rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.1s, border 0.1s, box-shadow 0.1s;
}
.topbar-link:hover { background: rgba(255, 255, 255, 0.3); }
.topbar-link.is-active {
  border-color: rgba(15, 23, 42, 0.05);
  background: #fff;
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.05);
}

.app-warning {
  margin-top: 0.7rem;
  padding: 0.4rem 0.65rem 0.45rem;
  background: #fff5f5;
  border: 1px solid #ffe4e6;
  border-radius: 14px;
  color: #b91c1c;
  font-size: 0.63rem;
  line-height: 1.4;
  text-align: center;
}
.footer-notice { margin-top: 1rem; text-align: center; }
footer { margin-top: 1.15rem; font-size: 0.7rem; color: var(--text-muted); }

.container {
  position: relative;
  margin-top: 0.5rem;
  padding: 1.3rem clamp(1rem, 2.1vw, 1.6rem) 1.6rem;
  background: var(--surface);
  border: 1px solid var(--border-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
}
.page-desc { margin: 0 0 1.1rem; font-size: 0.85rem; color: var(--text-muted); line-height: 1.5; }

.field {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 0.8rem 0.85rem 0.9rem;
  background: var(--surface-muted);
  border: 1px solid var(--border-faint);
  border-radius: 16px;
}
.field label {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  font-weight: 600;
  font-size: 0.78rem;
}
.field small { color: var(--text-muted); line-height: 1.4; }
.field-body { position: relative; display: flex; flex-direction: column; }

textarea,
input[type="text"] {
  width: 100%;
  padding: 0.55rem 0.65rem 0.6rem;
  font-size: 0.92rem;
  color: var(--text);
  background: #fff;
  border: 1px solid var(--border-soft);
  border-radius: 13px;
  outline: none;
  transition: border 0.12s, box-shadow 0.12s, background 0.12s;
}
textarea {
  min-height: 160px;
  max-height: 320px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}
textarea:focus,
input[type="text"]:focus {
  border-color: rgba(37, 99, 235, 0.85);
  box-shadow: var(--focus-ring);
  background: #fff;
}

.buttons-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.8rem;
  align-items: center;
}
.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.52rem 1.2rem 0.58rem;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.25);
  transition: transform 0.085s, box-shadow 0.085s, background 0.1s;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 16px 30px rgba(37, 99, 235, 0.25); }
.btn.secondary {
  background: #eef2ff;
  color: var(--text);
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: none;
}
.btn.secondary:hover {
  background: #b2c7f9;
  transform: translateY(-1px);
  box-shadow: none;
}

.toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 280px;
  padding: 0.5rem 0.85rem 0.45rem;
  background: #fff;
  color: var(--text);
  font-size: 0.72rem;
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 14px;
  box-shadow: 0 15px 40px rgba(15, 23, 42, 0.1);
  transform: translateY(120%);
  opacity: 0;
  transition: transform 0.22s, opacity 0.22s;
  z-index: 200;
}
.toast.show { transform: translateY(0); opacity: 1; }

.modal-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.1rem;
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(2px);
  z-index: 400;
}
.modal {
  width: min(430px, 100%);
  padding: 1rem 1rem 0.6rem;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.05);
  border-radius: 18px;
  box-shadow: 0 18px 44px rgba(15, 23, 42, 0.12);
}
.modal h3 { margin: 0 0 0.5rem; font-size: 0.9rem; }
.modal p { margin: 0 0 0.8rem; font-size: 0.76rem; color: var(--text-muted); }
.modal-footer { display: flex; justify-content: flex-end; gap: 0.4rem; margin-bottom: 0.35rem; }
.modal.success { border-color: rgba(16, 185, 129, 0.25); }

#loadingOverlay {
  position: absolute;
  inset: 0;
  display: none;
  gap: 0.65rem;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  background: rgba(243, 244, 246, 0.85);
  border-radius: var(--radius-lg);
  backdrop-filter: blur(1px);
  z-index: 20;
}
.loading-text { font-size: 0.78rem; color: var(--text); opacity: 0.8; }
.spinner {
  width: 46px;
  height: 46px;
  border: 3.5px solid rgba(37, 99, 235, 0.15);
  border-top-color: rgba(37, 99, 235, 1);
  border-radius: 999px;
  animation: spin 0.55s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

.qr-canvas-wrap {
  display: grid;
  place-items: center;
  padding: 0.6rem;
  background: #fff;
  border: 1px dashed var(--border-soft);
  border-radius: 14px;
}
#qrCanvas {
  width: 100%;
  height: auto;
  max-width: 512px;
  aspect-ratio: 1/1;
  border-radius: 8px;
  background: #fff;
}

.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.8rem;
}
.qr-col { display: flex; flex-direction: column; gap: 0.55rem; }

.doc-text.bad { color: #b91c1c; }

@media (max-width: 980px) {
  .two-col { grid-template-columns: 1fr; }
}
