:root {
  --navy: #0c2340;
  --navy-soft: #17345c;
  --gold: #c5a572;
  --gold-soft: #e8d7b5;
  --cream: #f6f1e7;
  --white: #fffdf8;
  --text: #1d2a3a;
  --muted: #5d6b7b;
  --line: #ddd4c4;
  --ok: #1f7a4d;
  --ok-bg: #e8f6ee;
  --danger: #a33b3b;
  --shadow: 0 18px 50px rgba(12, 35, 64, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #fff;
  background-color: var(--navy);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-color: var(--navy);
  background-image:
    linear-gradient(180deg, rgba(8, 22, 40, 0.28) 0%, rgba(8, 22, 40, 0.48) 100%),
    url("recife_brazil_temple_lds.jpg");
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
}

.page {
  min-height: 100vh;
  min-height: 100dvh;
  padding: 28px 16px 40px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}

.wrap {
  width: min(920px, 100%);
  margin: 0 auto;
}

.wrap-form,
.wrap-login {
  width: min(440px, 100%);
}

.brand {
  text-align: center;
  color: var(--gold-soft);
  margin-bottom: 22px;
  text-shadow: 0 2px 18px rgba(8, 22, 40, 0.55);
}

.brand p {
  margin: 0;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.72rem;
}

.brand h1 {
  margin: 8px 0 6px;
  color: #fff;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.15;
}

.card {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
}

.form-grid {
  display: grid;
  gap: 16px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 0.92rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 8px rgba(8, 22, 40, 0.7);
}

input,
select,
textarea {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  background: rgba(255, 253, 248, 0.96);
  color: var(--text);
  border-radius: 12px;
  padding: 13px 14px;
  font: inherit;
  font-size: 16px;
  box-shadow: 0 8px 24px rgba(8, 22, 40, 0.18);
}

input:focus,
select:focus {
  outline: 2px solid var(--gold);
  border-color: var(--gold);
}

.choice {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 50px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: 12px;
  background: rgba(255, 253, 248, 0.96);
  color: var(--text);
  text-shadow: none;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(8, 22, 40, 0.18);
}

.choice input {
  width: auto;
}

.choice label:has(input:checked) {
  border-color: var(--navy);
  background: #e8eef6;
}

.btn {
  appearance: none;
  border: 0;
  border-radius: 12px;
  padding: 13px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.btn-primary {
  width: 100%;
  min-height: 50px;
  background: var(--navy);
  color: #fff;
  box-shadow: 0 8px 24px rgba(8, 22, 40, 0.28);
}

.btn-gold {
  background: var(--gold);
  color: var(--navy);
}

.btn-ghost {
  background: #fff;
  color: var(--navy);
  border: 1px solid var(--line);
}

.btn-danger {
  background: #f8eaea;
  color: var(--danger);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hint,
.erro,
.muted {
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.95rem;
  text-shadow: 0 1px 8px rgba(8, 22, 40, 0.7);
}

.erro {
  color: #ffd4d4;
  min-height: 1.2em;
}

.success {
  text-align: center;
  padding: 28px 8px 12px;
}

.check {
  width: 88px;
  height: 88px;
  margin: 0 auto 16px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--ok-bg);
  color: var(--ok);
  font-size: 2.4rem;
  box-shadow: 0 0 0 10px rgba(31, 122, 77, 0.08);
}

.success h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: clamp(1.25rem, 5vw, 1.6rem);
  text-shadow: 0 2px 12px rgba(8, 22, 40, 0.7);
}

.toolbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.stats {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.stat {
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.45);
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 110px;
  color: var(--text);
  text-shadow: none;
}

.stat strong {
  display: block;
  font-size: 1.2rem;
  color: var(--navy);
}

.stat .muted {
  color: var(--muted);
  text-shadow: none;
}

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: collapse;
  background: #fff;
  color: #111;
  border-radius: 14px;
  overflow: hidden;
}

th,
td {
  text-align: left;
  padding: 12px;
  border-bottom: 1px solid var(--line);
  font-size: 0.94rem;
  vertical-align: top;
}

td {
  color: #111;
}

th {
  background: var(--navy);
  color: #fff;
  font-weight: 600;
}

.tag {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 700;
}

.tag-ok {
  background: var(--ok-bg);
  color: var(--ok);
}

.tag-no {
  background: #f8eaea;
  color: var(--danger);
}

.empty {
  text-align: center;
  padding: 28px 12px;
  color: #111;
}

.painel {
  background: #fff;
  color: #111;
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
}

.painel .empty,
.painel td,
.painel th {
  text-shadow: none;
}

.modal {
  border: 0;
  border-radius: 18px;
  padding: 20px;
  width: min(440px, calc(100vw - 24px));
  color: #111;
  background: #fff;
  box-shadow: var(--shadow);
}

.modal::backdrop {
  background: rgba(8, 22, 40, 0.6);
}

.modal-topo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-topo h3 {
  margin: 0;
  color: #111;
}

.modal label,
.modal strong {
  color: #111;
  text-shadow: none;
}

.modal .erro {
  color: var(--danger);
  text-shadow: none;
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  body::before {
    display: none;
  }

  .page {
    padding: 0;
  }

  .painel {
    box-shadow: none;
  }

  .no-print,
  .modal,
  .actions,
  .stats,
  td.no-print,
  td .btn {
    display: none !important;
  }

  .brand {
    color: #000;
    text-shadow: none;
    margin-bottom: 12px;
  }

  .brand h1 {
    color: #000;
  }

  .painel {
    background: #fff;
    padding: 0;
  }

  .table-wrap {
    overflow: visible;
  }

  table {
    display: table;
    width: 100%;
    min-width: 0;
    border-collapse: collapse;
    background: #fff;
    color: #000;
    border-radius: 0;
  }

  thead {
    display: table-header-group;
  }

  tbody {
    display: table-row-group;
  }

  tr {
    display: table-row;
    background: #fff;
    margin: 0;
    padding: 0;
    border-radius: 0;
  }

  th,
  td {
    display: table-cell;
    color: #000;
    background: #fff;
    border: 1px solid #000;
    padding: 8px 10px;
    text-align: left;
  }

  th {
    font-weight: 700;
    background: #eee;
  }

  td::before {
    content: none;
  }
}

@media screen and (max-width: 720px) {
  .page {
    padding-top: 20px;
    padding-bottom: 28px;
  }

  .brand h1 {
    font-size: clamp(1.55rem, 8vw, 2.1rem);
  }

  .form-grid {
    gap: 14px;
  }

  .toolbar {
    align-items: stretch;
  }

  .stats {
    width: 100%;
  }

  .stat {
    flex: 1;
    min-width: 0;
  }

  .actions,
  .actions .btn,
  td .btn {
    width: 100%;
  }

  table {
    min-width: 0;
    background: transparent;
  }

  thead {
    display: none;
  }

  tbody,
  tr,
  td {
    display: block;
  }

  tr {
    background: #fff;
    border-radius: 14px;
    margin-bottom: 12px;
    padding: 10px 12px;
    color: #111;
    overflow: hidden;
  }

  td {
    border: 0;
    padding: 8px 4px;
    display: flex;
    justify-content: space-between;
    gap: 12px;
  }

  td::before {
    content: attr(data-label);
    font-weight: 700;
    color: var(--navy);
  }

  td:last-child {
    display: block;
  }

  td:last-child::before {
    content: none;
  }
}
