@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,600;9..144,700&family=Space+Grotesk:wght@400;500;700&display=swap");

:root {
  --bg: #0f1720;
  --bg-soft: #162131;
  --panel: rgba(255, 255, 255, 0.07);
  --panel-strong: rgba(255, 255, 255, 0.12);
  --text: #f6f4ef;
  --muted: rgba(246, 244, 239, 0.7);
  --line: rgba(255, 255, 255, 0.12);
  --accent: #f4b942;
  --accent-2: #7ce6c0;
  --danger: #f38f8f;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.34);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(244, 185, 66, 0.22), transparent 30%),
    radial-gradient(circle at top right, rgba(124, 230, 192, 0.15), transparent 26%),
    linear-gradient(160deg, #091019 0%, #111b2b 55%, #0b1220 100%);
}

button,
input,
textarea,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.shell {
  min-height: 100vh;
}

.hidden {
  display: none !important;
}

.card {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0.05));
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.auth-screen,
.app-screen {
  width: min(1360px, calc(100vw - 24px));
  margin: 0 auto;
}

.auth-screen {
  display: grid;
  align-items: center;
  gap: 28px;
  min-height: 100vh;
  padding: 28px 0 40px;
}

.hero-copy,
.auth-card,
.sidebar,
.workspace,
.topbar,
.view,
.stat,
.pad {
  border-radius: var(--radius);
}

.hero-copy {
  padding: 20px 6px;
}

.brand-mark {
  width: 66px;
  height: 66px;
  border-radius: 20px;
  display: grid;
  place-items: center;
  background:
    linear-gradient(135deg, rgba(244, 185, 66, 0.98), rgba(255, 216, 133, 0.8));
  color: #1c2735;
  font-weight: 700;
  font-size: 1.35rem;
  box-shadow: 0 18px 44px rgba(244, 185, 66, 0.25);
}

.brand-mark.small {
  width: 46px;
  height: 46px;
  border-radius: 16px;
  font-size: 1rem;
}

.brand-lockup,
.sidebar-head,
.split-head,
.topbar,
.topbar-meta,
.camera-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.eyebrow,
.card-kicker {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.72rem;
  color: var(--accent);
}

h1,
h2,
h3,
.brand-name,
.topbar h2 {
  font-family: "Fraunces", Georgia, serif;
  margin: 0;
}

h1 {
  font-size: clamp(2.6rem, 6vw, 4.9rem);
  line-height: 0.95;
  max-width: 12ch;
  margin-top: 18px;
}

.lead,
.muted,
.hint,
.sidebar-note,
.inline-notice,
.tiny {
  color: var(--muted);
}

.lead {
  font-size: 1.1rem;
  line-height: 1.6;
  max-width: 62ch;
  margin: 18px 0 0;
}

.feature-list,
.steps {
  margin: 18px 0 0;
  padding-left: 18px;
  line-height: 1.8;
}

.auth-card {
  padding: 24px;
  width: min(100%, 480px);
  margin-left: auto;
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  font-size: 0.92rem;
}

input,
textarea,
select {
  width: 100%;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
  padding: 13px 14px;
  outline: none;
}

input::placeholder,
textarea::placeholder {
  color: rgba(246, 244, 239, 0.38);
}

input:focus,
textarea:focus,
select:focus {
  border-color: rgba(244, 185, 66, 0.75);
  box-shadow: 0 0 0 4px rgba(244, 185, 66, 0.14);
}

.inline-notice {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.app-screen {
  display: none;
  gap: 18px;
  padding: 18px 0 24px;
}

.app-screen.active {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
}

.sidebar {
  padding: 20px;
  display: grid;
  gap: 18px;
  align-self: start;
  position: sticky;
  top: 18px;
  min-height: calc(100vh - 36px);
}

.workspace {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.topbar {
  padding: 20px 22px;
}

.topbar-meta {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav {
  display: grid;
  gap: 8px;
}

.nav-btn,
.btn {
  border: 0;
  border-radius: 16px;
  padding: 13px 16px;
  font-weight: 700;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}

.nav-btn {
  width: 100%;
  text-align: left;
  color: var(--text);
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid transparent;
}

.nav-btn.active,
.nav-btn:hover {
  background: rgba(244, 185, 66, 0.16);
  border-color: rgba(244, 185, 66, 0.2);
}

.btn {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text);
}

.btn:hover,
.nav-btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, #f4b942, #f7d37a);
  color: #17212f;
}

.btn-secondary {
  background: rgba(124, 230, 192, 0.14);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
}

.tiny-btn {
  padding: 10px 14px;
  font-size: 0.85rem;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 999px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
}

.badge.soft {
  background: rgba(255, 255, 255, 0.05);
}

.toast {
  padding: 14px 16px;
  border-radius: 18px;
  background: rgba(124, 230, 192, 0.15);
  border: 1px solid rgba(124, 230, 192, 0.24);
}

.view {
  display: none;
  gap: 18px;
  padding: 0;
}

.view.active {
  display: grid;
}

.grid {
  display: grid;
}

.cols-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.cols-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tight {
  gap: 10px;
}

.spaced {
  gap: 18px;
}

.spaced-top {
  margin-top: 18px;
}

.pad {
  padding: 20px;
}

.stat {
  padding: 20px;
}

.stat strong {
  display: block;
  font-size: clamp(2rem, 4vw, 3rem);
  margin: 4px 0;
}

.cards-grid,
.results-list,
.list,
.activity-list {
  display: grid;
  gap: 12px;
}

.card-row,
.result-row,
.list-row,
.activity-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.05);
}

.actions-inline {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.form-preview {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.preview-page {
  border-radius: 20px;
  background: #f6f0e6;
  color: #1a2432;
  padding: 18px;
  min-height: 520px;
  box-shadow: inset 0 0 0 1px rgba(20, 28, 40, 0.06);
}

.preview-head {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 10px;
}

.preview-grid {
  margin-top: 18px;
  display: grid;
  gap: 12px;
}

.preview-row {
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 8px;
  align-items: center;
  font-size: 0.85rem;
}

.bubble-set {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.bubble {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 2px solid rgba(26, 36, 50, 0.3);
  display: inline-grid;
  place-items: center;
  font-size: 0.72rem;
  background: rgba(255, 255, 255, 0.75);
}

.bubble.filled {
  background: rgba(244, 185, 66, 0.34);
  border-color: #7a5c0a;
}

.summary-box {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.summary-item {
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.06);
}

.camera-frame {
  position: relative;
  min-height: 340px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.04);
}

.camera-frame video,
.scan-preview {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.camera-frame video {
  min-height: 340px;
  background: rgba(0, 0, 0, 0.28);
}

.scan-preview {
  margin-top: 14px;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.print-area {
  display: none;
}

@media print {
  body {
    background: #fff;
    color: #111;
  }

  .auth-screen,
  .sidebar,
  .topbar,
  .view:not([data-view-panel="forms"]),
  .nav-btn,
  .toast,
  .btn,
  .camera-actions,
  #scanForm,
  #resultsList,
  .hero-copy,
  #authScreen {
    display: none !important;
  }

  .app-screen {
    display: block !important;
    width: 100%;
  }

  #appScreen {
    padding: 0;
  }

  #printArea {
    display: block;
  }
}

@media (max-width: 1120px) {
  .app-screen.active {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    min-height: auto;
  }
}

@media (max-width: 820px) {
  .auth-screen,
  .cols-2,
  .cols-3 {
    grid-template-columns: 1fr;
  }

  .auth-screen {
    padding-top: 16px;
  }

  .topbar,
  .pad,
  .stat,
  .auth-card,
  .sidebar {
    padding: 18px;
  }
}
