:root {
  --burgundy: #6f1414;
  --deep-burgundy: #3d0c0c;
  --roman-red: #8f1f18;
  --gold: #b98b3a;
  --bright-gold: #d8b768;
  --parchment: #efe0bd;
  --parchment-dark: #d7bc86;
  --ink: #2d2115;
  --brown: #4a2e18;
  --shadow: rgba(35, 18, 8, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  font-family: Georgia, "Times New Roman", Times, serif;
  background:
    radial-gradient(circle at top, rgba(216, 183, 104, 0.22), transparent 35rem),
    linear-gradient(rgba(61, 12, 12, 0.82), rgba(61, 12, 12, 0.92)),
    repeating-linear-gradient(45deg, #4b1711 0 12px, #3d0c0c 12px 24px);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  opacity: 0.13;
  background-image:
    linear-gradient(90deg, transparent 97%, rgba(255,255,255,0.35) 100%),
    linear-gradient(0deg, transparent 97%, rgba(255,255,255,0.25) 100%);
  background-size: 34px 34px;
}

.page-shell {
  width: min(1120px, calc(100% - 28px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.hero {
  display: grid;
  place-items: center;
  margin-bottom: 24px;
}

.poster {
  max-width: 100%;
  width: min(760px, 100%);
  height: auto;
  display: block;
  border: 10px solid #2f1b0e;
  outline: 3px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(255,255,255,0.22) inset;
}

.roman-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--bright-gold);
  margin: 26px auto;
  text-shadow: 0 2px 4px #000;
  letter-spacing: 0.18em;
}

.roman-divider .line {
  width: min(220px, 23vw);
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

.spqr {
  padding: 6px 12px;
  border: 1px solid rgba(216, 183, 104, 0.75);
  background: rgba(111, 20, 20, 0.8);
  border-radius: 999px;
  font-weight: 700;
}

.decree-scroll {
  position: relative;
  overflow: hidden;
  padding: clamp(22px, 4vw, 46px);
  background:
    radial-gradient(circle at 18% 12%, rgba(255,255,255,0.32), transparent 12rem),
    linear-gradient(135deg, rgba(255,255,255,0.16), transparent 32%),
    var(--parchment);
  border: 8px double var(--brown);
  border-radius: 20px;
  box-shadow: 0 24px 64px var(--shadow), inset 0 0 36px rgba(89, 51, 22, 0.22);
}

.decree-scroll::before,
.decree-scroll::after {
  content: "";
  position: absolute;
  left: -2%;
  right: -2%;
  height: 22px;
  background: linear-gradient(90deg, #8a5f2d, #ead39e, #8a5f2d);
  border: 2px solid rgba(74, 46, 24, 0.75);
  box-shadow: 0 5px 12px rgba(0,0,0,0.22);
}

.decree-scroll::before { top: -10px; }
.decree-scroll::after { bottom: -10px; }

.eyebrow {
  margin: 0 0 8px;
  color: var(--burgundy);
  font-weight: 700;
  letter-spacing: 0.13em;
  text-align: center;
  text-transform: uppercase;
}

h1,
h2 {
  color: var(--burgundy);
  line-height: 1.1;
  text-align: center;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 4.4rem);
  text-shadow: 1px 1px 0 rgba(255,255,255,0.45);
}

h2 {
  margin: 0 0 18px;
  font-size: clamp(1.45rem, 3vw, 2.3rem);
}

.intro {
  max-width: 850px;
  margin: 18px auto 28px;
  font-size: clamp(1.08rem, 2.4vw, 1.35rem);
  line-height: 1.55;
  text-align: center;
}

.details-tablet,
.form-panel,
.official-decree {
  background:
    linear-gradient(135deg, rgba(255,255,255,0.16), transparent 45%),
    linear-gradient(#e6d0a0, #d7bc86);
  border: 4px solid var(--brown);
  border-radius: 14px;
  box-shadow: inset 0 0 0 2px rgba(185, 139, 58, 0.45), 0 14px 28px rgba(74, 46, 24, 0.2);
}

.details-tablet {
  max-width: 860px;
  margin: 0 auto 30px;
  padding: clamp(18px, 3vw, 28px);
}

.details-tablet dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 22px;
  margin: 0;
}

.details-tablet div {
  padding: 12px;
  border-left: 4px solid var(--burgundy);
  background: rgba(239, 224, 189, 0.58);
}

.details-tablet dt {
  color: var(--burgundy);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.details-tablet dd {
  margin: 5px 0 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.census-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(300px, 0.85fr);
  gap: 24px;
  align-items: start;
}

.form-panel,
.official-decree {
  padding: clamp(18px, 3vw, 28px);
}

form {
  display: grid;
  gap: 10px;
}

label {
  color: var(--deep-burgundy);
  font-size: 1.02rem;
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  min-height: 46px;
  padding: 12px 13px;
  color: var(--ink);
  font: 1rem Georgia, "Times New Roman", Times, serif;
  background: rgba(239, 224, 189, 0.78);
  border: 2px solid #8a5f2d;
  border-radius: 9px;
  box-shadow: inset 0 2px 6px rgba(74, 46, 24, 0.14);
}

textarea {
  resize: vertical;
  min-height: 98px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 3px solid rgba(185, 139, 58, 0.45);
  border-color: var(--burgundy);
}

.number-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.help {
  margin: -3px 0 9px;
  color: #68451f;
  font-size: 0.93rem;
  font-style: italic;
}

.seal-button {
  justify-self: center;
  margin-top: 12px;
  padding: 15px 28px;
  color: #fff2d1;
  font: 700 1.08rem Georgia, "Times New Roman", Times, serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
  background:
    radial-gradient(circle at 35% 25%, rgba(255,255,255,0.28), transparent 24%),
    linear-gradient(145deg, #a92820, var(--burgundy) 52%, #4a0f0e);
  border: 3px solid #4a0f0e;
  border-radius: 999px;
  box-shadow: 0 8px 0 #2d0908, 0 15px 22px rgba(45, 9, 8, 0.32), inset 0 0 0 2px rgba(216, 183, 104, 0.25);
}

.seal-button:hover,
.seal-button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 9px 0 #2d0908, 0 18px 26px rgba(45, 9, 8, 0.38), inset 0 0 0 2px rgba(216, 183, 104, 0.35);
}

.seal-button:disabled {
  cursor: wait;
  opacity: 0.72;
  transform: none;
}

.form-status {
  min-height: 1.2em;
  margin: 6px 0 0;
  color: var(--burgundy);
  font-weight: 700;
  text-align: center;
}

.official-decree {
  position: sticky;
  top: 18px;
  background:
    linear-gradient(rgba(111, 20, 20, 0.08), rgba(111, 20, 20, 0.02)),
    #ead7a8;
}

.decree-text {
  white-space: pre-line;
  padding: 18px;
  min-height: 280px;
  font-size: clamp(1.03rem, 2vw, 1.2rem);
  line-height: 1.55;
  background: rgba(239, 224, 189, 0.65);
  border: 2px dashed rgba(111, 20, 20, 0.5);
  border-radius: 12px;
}

.success-decree {
  padding: clamp(24px, 5vw, 44px);
  font-size: clamp(1.25rem, 3vw, 1.7rem);
  line-height: 1.5;
  text-align: center;
  background: rgba(239, 224, 189, 0.72);
  border: 3px double var(--burgundy);
  border-radius: 14px;
}

@media (max-width: 820px) {
  .page-shell {
    width: min(100% - 18px, 760px);
    padding-top: 12px;
  }

  .poster {
    border-width: 6px;
    outline-width: 2px;
  }

  .details-tablet dl,
  .census-grid,
  .number-row {
    grid-template-columns: 1fr;
  }

  .official-decree {
    position: static;
  }
}

@media (max-width: 520px) {
  .decree-scroll {
    padding: 22px 14px 28px;
    border-width: 5px;
  }

  .roman-divider {
    gap: 8px;
    letter-spacing: 0.08em;
  }

  .spqr {
    padding: 5px 8px;
  }

  h1 {
    font-size: 1.9rem;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }
}
