body {
  font-family: "Courier New", monospace;
  background: #f2f2f2;
  margin: 0;
  padding: 30px;
  color: #222;
}

* {
  box-sizing: border-box;
}

.page-shell {
  max-width: 1040px;
  margin: 0 auto;
}

.hero-card,
.panel {
  background: #fff;
  padding: 28px 32px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.12);
}

.hero-card {
  margin-bottom: 20px;
}

.panel + .panel {
  margin-top: 20px;
}

.panel-narrow {
  max-width: none;
}

.eyebrow {
  margin: 0 0 10px;
  color: #555;
  font-size: 14px;
  text-transform: uppercase;
}

.lede {
  margin: 14px 0 0;
  color: #444;
  line-height: 1.6;
}

.lede.compact {
  margin-top: 6px;
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.dashboard-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
  margin-bottom: 18px;
}

.dashboard-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-button,
.secondary-button,
.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.table-shell {
  overflow-x: auto;
}

.submissions-table {
  width: 100%;
  border-collapse: collapse;
}

.submissions-table th,
.submissions-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #ddd;
}

.form-page {
  max-width: 920px;
  margin: auto;
  background: #fff;
  padding: 50px 70px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.15);
}

.form-section {
  margin-top: 32px;
}

.form-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
  margin-bottom: 45px;
}

.title-block {
  flex: 1;
  text-align: center;
}

.title-block h1,
.title-block h2,
section h3 {
  text-transform: uppercase;
}

.title-block h1 {
  margin: 0;
  font-size: 22px;
}

.title-block h2 {
  margin: 10px 0 0;
  font-size: 20px;
}

.desktop-note {
  margin: 14px 0 0;
  color: #666;
  font-size: 14px;
  line-height: 1.6;
}

.logo-box {
  width: 146px;
  flex: 0 0 146px;
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
}

.logo-box img {
  display: block;
  width: 100%;
  height: auto;
}

section h3 {
  margin: 0 0 24px;
  font-size: 18px;
}

.row {
  display: flex;
  gap: 20px;
  margin-bottom: 8px;
  align-items: flex-start;
}

.row-double .field {
  flex: 1;
}

.row-triple .field {
  flex: 1;
}

.row-cpf-meta .field-medium {
  flex: 1.15;
}

.row-cpf-meta .field-state-civil {
  flex: 1;
}

.row-birth-age {
  justify-content: flex-start;
}

.row-birth-age .field-medium {
  flex: 0 0 360px;
  max-width: 360px;
}

.row-birth-age .field-short {
  flex: 0 0 140px;
  max-width: 140px;
}

.field {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  position: relative;
}

.field-full {
  width: 100%;
}

.field-short {
  max-width: 225px;
}

.field-medium {
  max-width: 330px;
}

.field-state-civil {
  max-width: 315px;
}

.field-batizado {
  flex: 1.15;
  max-width: 245px;
}

.field-paroquia-batismo {
  flex: 1.65;
}

.field-primeira-comunhao {
  flex: 1;
  max-width: 430px;
}

.field-frequenta-paroquia {
  flex: 1;
  max-width: 430px;
}

.field-primeira-comunhao .select-shell,
.field-frequenta-paroquia .select-shell {
  flex: 0 0 152px;
  width: 152px;
}

.field > span:not(.select-shell) {
  white-space: nowrap;
  font-weight: bold;
  text-transform: uppercase;
}

input,
select,
button {
  font: inherit;
}

input {
  width: 100%;
  border: none;
  border-bottom: 2px solid #444;
  font-size: 16px;
  padding: 4px;
  outline: none;
  background: transparent;
  background-image: linear-gradient(#0057a8, #0057a8);
  background-repeat: no-repeat;
  background-position: left bottom;
  background-size: 0 2px;
  transition:
    background-size 160ms ease,
    border-bottom-color 160ms ease,
    color 160ms ease;
}

input:focus {
  border-bottom-color: rgba(0, 87, 168, 0.28);
  background-size: 100% 2px;
  animation: focus-line-pulse 1s ease-in-out infinite alternate;
}

@keyframes focus-line-pulse {
  from {
    background-size: 100% 2px;
    filter: brightness(1);
  }

  to {
    background-size: 100% 3px;
    filter: brightness(1.18);
  }
}

.select-shell {
  display: block;
  position: relative;
  width: 100%;
}

.text-shell {
  display: block;
  width: 100%;
  max-width: 275px;
}

.select-shell::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 16px;
  width: 10px;
  height: 10px;
  border-right: 2px solid #264653;
  border-bottom: 2px solid #264653;
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
  transition: transform 160ms ease, border-color 160ms ease;
}

.select-shell select {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  border: 1px solid #9aa5ab;
  border-radius: 16px;
  padding: 12px 42px 12px 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f4f7f8 100%);
  color: #1f2a30;
  font-size: 15px;
  line-height: 1.25;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 1px 2px rgba(38, 70, 83, 0.08);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease,
    transform 160ms ease,
    background-color 160ms ease;
}

.select-shell select:focus {
  outline: none;
}

.select-shell:focus-within::after {
  border-color: #0057a8;
  transform: translateY(-45%) rotate(45deg);
}

.select-shell:focus-within select {
  border-color: #0057a8;
  background: linear-gradient(180deg, #ffffff 0%, #eef6ff 100%);
  box-shadow:
    0 0 0 4px rgba(0, 87, 168, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.96);
}

.field:has(.select-shell:focus-within) span {
  color: #0057a8;
}

.field-invalid input,
.field-invalid .select-shell select,
.check-block.field-invalid {
  border-bottom-color: #a02222;
}

.field-invalid .select-shell select {
  border: 1px solid #a02222;
  box-shadow: 0 0 0 3px rgba(160, 34, 34, 0.08);
}

.field-invalid .select-shell::after {
  border-color: #a02222;
}

.field-error {
  display: block;
  min-height: 18px;
  color: #a02222;
  font-size: 13px;
  margin: 0 0 6px;
}

.row-error {
  padding-left: 2px;
}

.notes {
  margin-top: 45px;
}

.notes ul {
  margin: 0;
  padding-left: 22px;
  line-height: 1.9;
  font-size: 15px;
}

.notes li {
  margin-bottom: 10px;
}

.verification-block {
  margin-top: 42px;
}

.turnstile-shell {
  margin-bottom: 20px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.admin-login-inline {
  display: grid;
  grid-template-columns: minmax(260px, 330px) 300px;
  align-items: center;
  justify-content: start;
  column-gap: 12px;
  row-gap: 10px;
  margin-bottom: 4px;
}

.admin-totp-field {
  width: 100%;
  max-width: 330px;
  align-self: center;
}

.admin-turnstile-shell {
  width: 300px;
  justify-content: flex-start;
  margin-bottom: 0;
  align-self: center;
}

.admin-turnstile-placeholder {
  width: 300px;
  max-width: 300px;
  min-height: 72px;
  margin: 0 0 0 auto;
  padding: 0;
}

.turnstile-placeholder {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 360px;
  max-width: 360px;
  margin: 0 auto;
  overflow: visible;
  padding: 10px 14px 14px;
}

#turnstile-container {
  overflow: visible;
}

.check-block {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.check-block-inline {
  flex: 1;
  min-height: 100%;
  padding: 10px 12px;
  justify-content: flex-start;
  transition: background-color 160ms ease, box-shadow 160ms ease;
}

.check-block-inline:focus-within {
  background: rgba(0, 87, 168, 0.06);
  box-shadow: inset 0 0 0 1px rgba(0, 87, 168, 0.18);
}

.check-block input {
  width: auto;
  margin-top: 2px;
  flex: 0 0 auto;
}

.check-block span {
  font-weight: bold;
}

.actions {
  margin-top: 35px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 12px;
}

button {
  padding: 10px 18px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-weight: bold;
  background: #222;
  color: white;
}

button.secondary {
  background: #777;
}

.inline-status {
  min-height: 20px;
  margin-right: auto;
  color: #444;
}

.feedback-modal {
  max-width: 540px;
  width: calc(100% - 24px);
  border: none;
  padding: 0;
  background: transparent;
}

.feedback-modal::backdrop {
  background: rgba(0, 0, 0, 0.35);
}

.modal-card {
  background: white;
  padding: 28px;
  box-shadow: 0 0 12px rgba(0, 0, 0, 0.2);
}

.modal-card p {
  line-height: 1.7;
}

code {
  font-family: inherit;
}

@media print {
  body {
    background: white;
    padding: 0;
  }

  .form-page {
    box-shadow: none;
    padding: 30px 50px;
  }

  .actions {
    display: none;
  }
}

@media (max-width: 760px) {
  body {
    padding: 0;
    background: #f3f3f3;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  }

  .form-page {
    max-width: none;
    background: transparent;
    padding: 0 0 96px;
    box-shadow: none;
  }

  .page-shell {
    max-width: none;
  }

  .hero-card,
  .panel {
    margin: 14px;
    padding: 18px;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }

  .dashboard-head,
  .dashboard-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .form-header {
    background: #222;
    color: #fff;
    padding: 18px 16px 22px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    gap: 14px;
  }

  .title-block {
    text-align: left;
    flex: 1;
  }

  .title-block h1 {
    font-size: 18px;
    margin-bottom: 6px;
  }

  .title-block h2 {
    font-size: 15px;
    margin: 0;
  }

  .desktop-note {
    display: none;
  }

  .logo-box {
    display: flex;
    width: 92px;
    flex: 0 0 92px;
  }

  .form-section {
    background: #fff;
    border-radius: 16px;
    padding: 18px;
    margin: 14px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  }

  .notes.form-section,
  .verification-block.form-section {
    margin-top: 14px;
  }

  section h3 {
    font-size: 17px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
    margin-bottom: 16px;
  }

  .row,
  .field {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .row {
    gap: 0;
    margin-bottom: 0;
  }

  .field {
    margin-bottom: 16px;
  }

  .field-short,
  .field-medium,
  .field-state-civil,
  .field-batizado,
  .field-paroquia-batismo,
  .field-primeira-comunhao,
  .field-frequenta-paroquia {
    max-width: none;
  }

  .row-birth-age .field-medium,
  .row-birth-age .field-short {
    flex: 1 1 auto;
    max-width: none;
  }

  .field-primeira-comunhao .select-shell,
  .field-frequenta-paroquia .select-shell {
    flex: 1 1 auto;
    width: 100%;
  }

  .field > span:not(.select-shell) {
    white-space: normal;
    font-size: 14px;
  }

  input,
  .select-shell select {
    min-height: 52px;
    font-size: 16px;
  }

  input:focus,
  .select-shell:focus-within select {
    outline: 3px solid rgba(0, 86, 179, 0.2);
  }

  .select-shell select {
    border-radius: 14px;
    padding: 12px 44px 12px 14px;
    background: linear-gradient(180deg, #ffffff 0%, #f6f8f9 100%);
  }

  .field-invalid input,
  .field-invalid .select-shell select,
  .check-block.field-invalid {
    border: 1px solid #a02222;
    border-bottom-color: #a02222;
  }

  .notes {
    margin-top: 0;
  }

  .notes ul {
    padding-left: 20px;
    line-height: 1.6;
    font-size: 14px;
  }

  .notes li {
    margin-bottom: 10px;
  }

  .turnstile-shell {
    margin-bottom: 16px;
  }

  .admin-login-inline {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 0;
  }

  .admin-totp-field {
    flex: 1 1 auto;
    max-width: none;
  }

  .admin-turnstile-shell {
    justify-content: center;
    width: 100%;
  }

  .admin-turnstile-placeholder {
    width: 180px;
    max-width: 180px;
    min-height: 150px;
    padding: 10px 12px 16px;
  }

  .turnstile-placeholder {
    width: 180px;
    max-width: 180px;
    min-height: 150px;
    padding: 10px 12px 16px;
  }

  .text-shell {
    max-width: none;
  }

  .actions {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 12px;
    background: #fff;
    box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.14);
    margin-top: 0;
  }

  .inline-status {
    grid-column: 1 / -1;
    margin-right: 0;
    min-height: 18px;
    font-size: 14px;
  }

  button {
    width: 100%;
    min-height: 52px;
    border-radius: 12px;
  }
}
