:root {
  --bg: #f4efe6;
  --bg-accent:
    radial-gradient(
      circle at top left,
      rgba(189, 141, 74, 0.28),
      transparent 32%
    ),
    radial-gradient(
      circle at top right,
      rgba(43, 95, 86, 0.2),
      transparent 28%
    ),
    #f4efe6;
  --panel: rgba(255, 251, 245, 0.9);
  --panel-strong: #fffdf8;
  --ink: #17211c;
  --muted: #59655f;
  --line: rgba(23, 33, 28, 0.12);
  --brand: #1e5b52;
  --brand-contrast: #f4efe6;
  --brand-soft: #dceae5;
  --warning: #a85a2b;
  --warning-soft: #f6e5d8;
  --success: #215b3b;
  --success-soft: #ddeee3;
  --danger: #a03535;
  --shadow: 0 18px 40px rgba(31, 30, 26, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Space Grotesk", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--bg-accent);
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

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

form {
  margin: 0;
}

button,
.primary-button,
.ghost-button {
  border-radius: 999px;
  padding: 0.85rem 1.15rem;
  border: none;
  cursor: pointer;
  transition:
    transform 140ms ease,
    box-shadow 140ms ease,
    background 140ms ease;
}

button:hover,
.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-1px);
}

.primary-button {
  background: var(--brand);
  color: var(--brand-contrast);
  box-shadow: var(--shadow);
}

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

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

.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  padding: 1.25rem 0;
}

.brand {
  font-family: "Source Serif 4", serif;
  font-size: 1.6rem;
  font-weight: 700;
}

.brand-subtitle,
.muted {
  color: var(--muted);
}

.topbar-actions,
.pill-row,
.button-row,
.hero-actions,
.form-actions,
.answer-meta,
.choice-row,
.sticky-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: center;
}

.main-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  margin-bottom: 1rem;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
  border-radius: 999px;
  border: 1px solid var(--line);
}

.main-nav a {
  padding: 0.5rem 0.85rem;
  border-radius: 999px;
}

.main-nav a:hover {
  background: rgba(30, 91, 82, 0.08);
}

.hero,
.page-header,
.card,
.auth-panel {
  background: var(--panel);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.hero,
.page-header,
.card,
.auth-panel,
.subcard {
  border-radius: 28px;
  padding: 1.4rem;
}

.hero {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
  min-height: 210px;
  background:
    linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.65),
      rgba(255, 255, 255, 0.4)
    ),
    linear-gradient(135deg, rgba(30, 91, 82, 0.22), rgba(206, 144, 76, 0.12));
}

.eyebrow {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--muted);
}

.hero h1,
.page-header h1,
.auth-panel h1 {
  margin: 0.2rem 0 0.5rem;
  font-family: "Source Serif 4", serif;
  font-size: clamp(2rem, 3vw, 3rem);
}

.hero-copy {
  max-width: 52ch;
  color: var(--muted);
}

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

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

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card-header,
.answer-topline,
.report-row-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.stat-card {
  text-align: left;
}

.stat-number {
  display: block;
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  margin-bottom: 0.35rem;
}

.list-stack,
.answer-stack,
.report-answer-stack {
  display: grid;
  gap: 0.85rem;
}

.list-item,
.subcard,
.answer-card,
.report-row {
  background: var(--panel-strong);
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 1rem;
}

.list-item {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: center;
}

.pill,
.user-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
}

.pill.soft,
.user-chip {
  background: var(--brand-soft);
}

.pill.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.pill.success {
  background: var(--success-soft);
  color: var(--success);
}

.form-card,
.inline-form {
  display: grid;
  gap: 1rem;
}

label {
  display: grid;
  gap: 0.45rem;
}

.label-title,
label span {
  font-weight: 600;
}

input[type="text"],
input[type="email"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  padding: 0.9rem 1rem;
  color: var(--ink);
}

textarea {
  resize: vertical;
}

.plain-list {
  margin: 0;
  padding-left: 1rem;
  display: grid;
  gap: 0.45rem;
}

.choice-row {
  align-items: stretch;
}

.choice-pill {
  position: relative;
  flex: 1 1 120px;
}

.choice-pill input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.choice-pill span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  text-align: center;
}

.choice-pill input:checked + span {
  background: var(--brand);
  color: var(--brand-contrast);
  border-color: var(--brand);
}

.toggle-row {
  display: inline-flex;
  gap: 0.55rem;
  align-items: center;
}

.checkbox-grid {
  display: grid;
  gap: 0.75rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.section-card {
  display: grid;
  gap: 1rem;
}

.attachment-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 0.75rem;
}

.attachment-thumb {
  display: grid;
  gap: 0.45rem;
  font-size: 0.85rem;
}

.attachment-thumb img {
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 18px;
  border: 1px solid var(--line);
}

.info-button {
  width: 2.2rem;
  height: 2.2rem;
  padding: 0;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 700;
}

.info-panel {
  background: rgba(30, 91, 82, 0.08);
  border-radius: 18px;
  padding: 0.9rem;
  color: var(--muted);
}

.sticky-actions {
  position: sticky;
  bottom: 1rem;
  justify-content: flex-end;
  padding: 1rem;
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid var(--line);
  border-radius: 24px;
  backdrop-filter: blur(12px);
}

.flash-stack {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.flash {
  padding: 0.9rem 1rem;
  border-radius: 18px;
}

.flash-success {
  background: var(--success-soft);
  color: var(--success);
}
.flash-error {
  background: #f8dfdf;
  color: var(--danger);
}
.flash-info {
  background: #dfe9f5;
  color: #345375;
}

.auth-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.auth-panel {
  width: min(720px, 100%);
  display: grid;
  gap: 1rem;
}

.auth-panel-wide {
  width: min(980px, 100%);
}

.compact-card {
  gap: 0.5rem;
}

.brf-pic {
  width: 145px;
  /* height: 60px; */
}

footer {
  margin-top: 30px;
  width: 100%;
  padding: 34px 0;
  border-top: 1px solid;
  color: var(--brand);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  font-size: 15px;
}

@media (max-width: 760px) {
  .page-shell {
    padding: 0.85rem;
  }

  .topbar,
  .hero,
  .card-header,
  .answer-topline,
  .list-item {
    flex-direction: column;
    align-items: stretch;
  }

  .main-nav {
    border-radius: 24px;
  }

  .sticky-actions {
    bottom: 0.5rem;
    justify-content: stretch;
  }

  .sticky-actions .primary-button,
  .sticky-actions .ghost-button {
    flex: 1 1 100%;
  }
}
