:root {
  --ink: #18201d;
  --ink-soft: #5d6762;
  --paper: #f4f2ec;
  --white: #fffefa;
  --line: #dcd8ce;
  --gold: #9d742d;
  --gold-dark: #76541d;
  --green: #07172F;
  --navy-secondary: #0C2954;
  --danger: #973f3f;
  --shadow: 0 24px 80px rgba(24, 32, 29, .12);
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 12%, rgba(157,116,45,.08), transparent 25rem),
    linear-gradient(135deg, #f8f7f2 0%, var(--paper) 65%, #ebe8df 100%);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button, input { font: inherit; }
button { cursor: pointer; }

.site-shell { min-height: 100vh; display: grid; grid-template-rows: auto 1fr auto; }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 26px clamp(24px, 5vw, 72px);
}
.brand { display: flex; gap: 14px; align-items: center; color: inherit; text-decoration: none; }
.mark {
  display: block; width: 48px; height: 48px; object-fit: contain;
  background: transparent; border-radius: 0; box-shadow: none;
}
.brand-copy strong { display: block; font-family: Georgia, serif; font-size: 18px; letter-spacing: .015em; }
.brand-copy span { display: block; margin-top: 3px; color: var(--ink-soft); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; }
.tag { color: var(--gold-dark); font-size: 12px; letter-spacing: .12em; text-transform: uppercase; }

.entry-main { display: grid; place-items: center; padding: 24px; }
.entry-grid {
  width: min(1100px, 100%); display: grid; grid-template-columns: 1.05fr .95fr;
  min-height: 600px; overflow: hidden; border: 1px solid rgba(24,32,29,.08);
  border-radius: 18px; background: rgba(255,254,250,.86); box-shadow: var(--shadow); backdrop-filter: blur(16px);
}
.intro { position: relative; padding: clamp(48px, 7vw, 84px); background: var(--green); color: white; overflow: hidden; }
.intro::after {
  content: "3C"; position: absolute; right: -38px; bottom: -96px;
  color: rgba(255,255,255,.045); font: 700 260px/1 Georgia, serif; letter-spacing: -.12em;
}
.eyebrow { margin: 0 0 22px; color: #d7bb80; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }
h1 { max-width: 590px; margin: 0; font: 400 clamp(42px, 5vw, 68px)/1.02 Georgia, serif; letter-spacing: -.035em; }
.intro-text { max-width: 520px; margin: 30px 0 0; color: rgba(255,255,255,.72); font-size: 17px; line-height: 1.75; }
.pillars { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 44px; }
.pillars span { padding: 9px 12px; border: 1px solid rgba(255,255,255,.18); border-radius: 999px; color: rgba(255,255,255,.78); font-size: 12px; }

.access { display: flex; align-items: center; padding: clamp(40px, 6vw, 72px); }
.access-inner { width: 100%; max-width: 420px; margin: auto; }
.step-label { color: var(--gold-dark); font-size: 12px; letter-spacing: .16em; text-transform: uppercase; }
h2 { margin: 12px 0 10px; font: 400 34px/1.15 Georgia, serif; }
.subcopy { margin: 0 0 32px; color: var(--ink-soft); line-height: 1.6; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { margin-bottom: 17px; }
.field label { display: block; margin-bottom: 8px; font-size: 12px; font-weight: 650; letter-spacing: .035em; }
.field input {
  width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px;
  background: rgba(255,255,255,.72); color: var(--ink); outline: none; transition: .18s ease;
}
.field input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(157,116,45,.12); background: white; }
.code-input { font-size: 22px; font-weight: 700; letter-spacing: .3em; text-align: center; }
.primary {
  width: 100%; height: 52px; border: 0; border-radius: 8px; background: var(--green); color: white;
  font-weight: 650; letter-spacing: .02em; transition: .18s ease; box-shadow: 0 10px 24px rgba(7,23,47,.16);
}
.primary:hover { transform: translateY(-1px); background: var(--navy-secondary); }
.primary:disabled { opacity: .55; transform: none; cursor: wait; }
.secondary { border: 0; padding: 0; background: transparent; color: var(--gold-dark); font-weight: 650; }
.code-actions { display: flex; justify-content: space-between; gap: 20px; align-items: center; margin-top: 17px; font-size: 13px; }
.hidden { display: none !important; }
.message { min-height: 22px; margin: 16px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.5; }
.message.error { color: var(--danger); }
.message.success { color: var(--green); }
.privacy { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--ink-soft); font-size: 11px; line-height: 1.5; }
.footer { padding: 24px; text-align: center; color: #777f7b; font-size: 11px; }

.report-body { background: #e9e7e0; }
.report-topbar {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between;
  padding: 14px clamp(18px, 4vw, 52px); background: rgba(255,254,250,.94); border-bottom: 1px solid var(--line); backdrop-filter: blur(14px);
}
.report-meta { display: flex; align-items: center; gap: 18px; }
.report-title { font-family: Georgia, serif; font-size: 18px; }
.report-edition { color: var(--ink-soft); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; }
.viewer-id { max-width: 280px; overflow: hidden; color: var(--ink-soft); font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.logout { padding: 9px 13px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); }
.report-stage { width: min(1180px, 100%); margin: 0 auto; padding: 34px clamp(10px, 3vw, 30px) 80px; }
.report-notice { margin: 0 auto 22px; padding: 12px 16px; border: 1px solid #d4cfbf; border-radius: 8px; background: #f4f0e3; color: #5e5b51; font-size: 12px; text-align: center; }
.pages { display: grid; gap: 28px; }
.page-wrap { position: relative; margin: auto; width: 100%; max-width: 1050px; background: white; box-shadow: 0 18px 54px rgba(16,22,20,.18); }
.report-canvas { display: block; width: 100%; height: auto; user-select: none; -webkit-user-drag: none; }
.page-number { position: absolute; right: 12px; bottom: 9px; padding: 4px 7px; border-radius: 4px; background: rgba(24,32,29,.7); color: white; font-size: 10px; }
.loading { padding: 80px 20px; text-align: center; color: var(--ink-soft); }

@media (max-width: 820px) {
  .tag { display: none; }
  .entry-grid { grid-template-columns: 1fr; }
  .intro { padding: 46px 34px; }
  .intro h1 { font-size: 42px; }
  .access { padding: 42px 28px; }
  .form-row { grid-template-columns: 1fr; gap: 0; }
  .brand-copy span { display: none; }
  .report-edition { display: none; }
  .viewer-id { max-width: 150px; }
}

/* Consent, support and legal pages */
a { color: var(--gold-dark); }
.top-actions { display: flex; align-items: center; gap: 22px; }
.support-nav, .tag-link { color: var(--gold-dark); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-decoration: none; text-transform: uppercase; }
.support-nav:hover, .tag-link:hover { text-decoration: underline; }
.subcopy.compact { margin-bottom: 16px; }
.agreement-scroll {
  max-height: 230px; overflow: auto; margin: 0 0 16px; padding: 16px;
  border: 1px solid var(--line); border-radius: 8px; background: rgba(244,242,236,.7);
  color: #3f4945; font-size: 12px; line-height: 1.55; outline: none;
}
.agreement-scroll:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(157,116,45,.1); }
.agreement-scroll h3 { margin: 16px 0 7px; color: var(--ink); font: 700 13px/1.3 Georgia, serif; }
.agreement-scroll h3:first-of-type { margin-top: 8px; }
.agreement-scroll p { margin: 0 0 10px; }
.agreement-version { margin: 0 0 10px !important; color: var(--gold-dark); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.checkbox-row { display: grid; grid-template-columns: 19px 1fr; gap: 11px; align-items: start; margin: 13px 0; color: #44504b; font-size: 12px; line-height: 1.5; cursor: pointer; }
.checkbox-row input { width: 17px; height: 17px; margin: 2px 0 0; accent-color: var(--green); }
.consent-edit { display: block; margin: 14px auto 0; }
.privacy a, .footer a { color: inherit; }

.support-main, .legal-main { padding: 30px 24px 70px; }
.support-grid {
  width: min(1100px, 100%); margin: 0 auto; display: grid; grid-template-columns: 1.05fr .95fr;
  overflow: hidden; border: 1px solid rgba(24,32,29,.08); border-radius: 18px;
  background: rgba(255,254,250,.88); box-shadow: var(--shadow); backdrop-filter: blur(16px);
}
.support-story { padding: clamp(48px, 7vw, 82px); background: var(--green); color: white; }
.support-story h1 { font-size: clamp(40px, 4.6vw, 62px); }
.support-story .intro-text { margin-top: 24px; }
.support-list { display: grid; gap: 18px; margin-top: 34px; }
.support-list div { display: grid; grid-template-columns: 32px 1fr; gap: 12px; color: rgba(255,255,255,.76); font-size: 13px; line-height: 1.55; }
.support-list strong { color: white; }
.support-icon { display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid rgba(255,255,255,.25); border-radius: 50%; color: #e5ca91; font-weight: 800; }
.support-card { padding: clamp(38px, 5vw, 66px); }
.amount-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 20px 0 18px; }
.amount-button { height: 46px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font-weight: 750; }
.amount-button.selected { border-color: var(--green); background: var(--green); color: white; }
.custom-row { display: grid; grid-template-columns: 38px 1fr; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: white; }
.custom-row span { text-align: center; color: var(--ink-soft); }
.custom-row input { border: 0; box-shadow: none; }
.legal-box { margin-top: 20px; padding: 14px; border: 1px solid #d9cfad; border-radius: 8px; background: #f7f1df; color: #5a5545; font-size: 11px; line-height: 1.55; }
.success-banner, .cancel-banner { margin-bottom: 18px; padding: 13px 15px; border-radius: 8px; font-size: 12px; line-height: 1.5; }
.success-banner { border: 1px solid #9bb9a8; background: #edf5f0; color: #244c3c; }
.cancel-banner { border: 1px solid #d8cdae; background: #faf5e9; color: #665c45; }

.legal-page { width: min(840px, 100%); margin: 0 auto; padding: clamp(34px, 6vw, 70px); border: 1px solid rgba(24,32,29,.08); border-radius: 18px; background: rgba(255,254,250,.9); box-shadow: var(--shadow); }
.legal-page h1 { font-size: clamp(40px, 5vw, 60px); }
.legal-page h2 { margin: 30px 0 9px; font-size: 24px; }
.legal-page p { color: #4e5954; line-height: 1.7; }
.effective-date { color: var(--gold-dark) !important; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

.report-actions { display: flex; align-items: center; gap: 9px; }
.report-link { padding: 9px 13px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); font-size: 13px; text-decoration: none; }
.report-link:hover { border-color: var(--gold); }

@media (max-width: 820px) {
  .top-actions { gap: 12px; }
  .support-nav { font-size: 11px; }
  .support-grid { grid-template-columns: 1fr; }
  .support-story, .support-card { padding: 40px 28px; }
  .amount-grid { grid-template-columns: repeat(2, 1fr); }
  .agreement-scroll { max-height: 250px; }
  .report-actions { gap: 6px; }
  .report-link { padding: 8px 9px; font-size: 11px; }
}

@media (max-width: 520px) {
  .brand-copy strong { font-size: 16px; }
  .topbar { padding: 20px 18px; }
  .support-nav { display: none; }
  .access { padding: 34px 22px; }
  .entry-main { padding: 12px; }
  .agreement-scroll { max-height: 210px; }
}

/* Report repository selector */
.report-library {
  margin: 0 auto 18px;
  padding: 17px 18px;
  display: grid;
  grid-template-columns: minmax(0,1fr) minmax(260px,420px);
  gap: 20px;
  align-items: center;
  border: 1px solid #d4cfbf;
  border-radius: 9px;
  background: #ffffff;
}
.report-library > div { min-width: 0; }
.library-label { display: block; color: var(--gold); font-size: 10px; font-weight: 800; letter-spacing: .15em; text-transform: uppercase; }
#library-title { display: block; margin-top: 5px; font-family: Georgia, serif; font-size: 22px; font-weight: 500; }
#library-description { display: block; margin-top: 5px; color: var(--ink-soft); font-size: 11px; line-height: 1.45; }
.report-select-wrap { display: block; }
.report-select-wrap > span { display: block; margin-bottom: 6px; color: var(--ink-soft); font-size: 10px; font-weight: 750; letter-spacing: .08em; text-transform: uppercase; }
.report-select-wrap select { width: 100%; padding: 11px 38px 11px 12px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink); background: white; font: 13px Arial, sans-serif; }
.report-select-wrap select:focus { outline: 2px solid rgba(152,111,31,.22); border-color: var(--gold); }
@media(max-width:760px) {
  .report-library { grid-template-columns: 1fr; gap: 12px; }
}
