/* Filtros e cartões. As larguras são fluidas até ao limite central. */
.filters-panel {
  margin-block: 48px 50px;
  border-radius: 28px;
  padding: 30px 38px 34px;
  box-shadow: var(--shadow);
}
.selected-location {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 26px;
}
.selected-location h1 {
  font-size: 16px;
  color: #777;
  font-weight: 500;
  line-height: 1.5;
  margin: 0;
}
.selected-location h1 strong {
  color: var(--navy);
  margin-left: 8px;
}
.filter-title {
  color: #777;
  font-size: 18px;
  font-weight: 500;
  margin-bottom: 22px;
}
.filters-grid {
  display: grid;
  grid-template-columns: 1.45fr 1.65fr 1fr 1fr;
  gap: 18px;
}
.filters-grid fieldset {
  border: 0;
  margin: 0;
  min-width: 0;
}
.gender-filter {
  display: flex;
  padding: 0;
  gap: 8px;
}
.gender {
  border: 0;
  color: #fff;
  letter-spacing: 0.1em;
  font-weight: 600;
  flex: 1;
  min-height: 100px;
}
.gender.girl {
  background: #f7b5f4;
  border-radius: 23px 0 0 23px;
}
.gender.boy {
  background: #85d4e8;
  border-radius: 0 23px 23px 0;
}
.gender[aria-pressed="true"] {
  box-shadow: inset 0 0 0 3px var(--navy);
  color: var(--navy);
}
.age-filter {
  border-radius: 23px;
  background: var(--gray);
  padding: 16px !important;
  position: relative;
}
.age-filter legend {
  float: left;
  font-size: 12px;
  font-weight: 600;
  color: #101010;
  width: 100%;
}
.age-filter legend span {
  font-weight: 400;
  color: #777;
}
.ranges {
  display: flex;
  clear: both;
  padding-top: 15px;
  gap: 10px;
}
.ranges label {
  font-size: 10px;
  width: 50%;
  color: #444;
}
.ranges input {
  width: 100%;
  accent-color: var(--navy);
  cursor: pointer;
}
.institution-filter {
  background: var(--gray);
  border-radius: 23px;
  padding: 15px;
  position: relative;
}
.institution-filter > span {
  font-size: 12px;
  font-weight: 600;
  color: #101010;
}
.institution-filter > div {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}
.institution-filter img {
  width: 40px;
  height: 40px;
}
.institution-filter .button {
  font-size: 13px;
  padding: 5px 9px;
  min-height: 35px;
}
#institution-menu {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 5;
  min-width: 220px;
  padding: 15px;
  background: #fff;
  box-shadow: var(--shadow);
  border-radius: 0 0 15px 15px;
}
#institution-menu label {
  display: flex;
  gap: 7px;
  align-items: center;
  font-size: 13px;
  padding: 6px;
  white-space: nowrap;
}
#institution-menu input {
  accent-color: var(--navy);
  width: 16px;
  height: 16px;
}
.available-count {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: #3296b0;
  color: #fff;
  border-radius: 23px;
  padding: 15px;
}
.available-count strong {
  font-size: 48px;
  font-weight: 400;
  line-height: 1;
}
.available-count span {
  font-size: 9px;
  line-height: 1.5;
}
.children-band {
  background: var(--band);
  padding: 35px 0 24px;
}
.carousel h2 {
  color: white;
  font-size: 19px;
  font-weight: 600;
  margin: 0 0 28px 10px;
}
.children-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
  min-height: 290px;
}
.child-card {
  border-radius: 27px;
  background: white;
  box-shadow: 0 12px 15px #0001;
  overflow: hidden;
  --child-color: var(--blue);
}
.child-card.girl {
  --child-color: #ed7ee6;
}
.child-header {
  background: var(--child-color);
  color: white;
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 24px 20px;
  min-height: 112px;
}
.child-header img {
  width: 65px;
  height: 58px;
  object-fit: contain;
}
.child-header h3 {
  font-size: 19px;
  margin: 0 0 6px;
  font-weight: 600;
}
.child-header p {
  font-size: 15px;
  margin: 0;
}
.child-body {
  padding: 22px 22px 18px;
}
.child-detail {
  display: flex;
  gap: 13px;
  margin-bottom: 18px;
  align-items: center;
  color: #222;
  font-size: 11px;
}
.child-detail img {
  width: 26px;
  height: 29px;
  object-fit: contain;
}
.child-detail strong {
  display: block;
  font-size: 10px;
  color: var(--navy);
}
.child-card .button {
  width: 100%;
  padding: 9px 8px;
  background: var(--child-color);
  color: white;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 35px;
  margin-top: 24px;
}
.pagination p {
  margin: 0;
  font-weight: 600;
}
.page-arrow {
  border: 0;
  background: none;
  font-size: 38px;
  line-height: 1;
  color: var(--navy);
  padding: 5px 15px;
}
.page-arrow:disabled {
  opacity: 0.3;
}
.empty-state {
  grid-column: 1/-1;
  align-self: center;
  text-align: center;
  padding: 40px 20px;
}
.empty-state .button {
  margin-top: 12px;
}
.sponsorship-panel {
  box-shadow: var(--shadow);
  border-radius: 26px;
  margin-top: 65px;
  padding-bottom: 28px;
}
.sponsorship-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: #93c8e2;
  border-radius: 26px;
  color: white;
  padding: 28px 34px;
}
.sponsorship-heading h2 {
  font-size: 17px;
  font-weight: 600;
  margin: 0;
}
.sponsorship-heading > span {
  background: #e6f2f9;
  border-radius: 25px;
  padding: 7px 15px;
  color: #17202b;
  white-space: nowrap;
}
.sponsored-list {
  padding: 28px 34px 0;
  display: grid;
  gap: 20px;
}
.sponsored-row {
  background: var(--gray);
  border-radius: 24px;
  padding: 18px 20px;
  display: flex;
  gap: 20px;
  align-items: center;
}
.sponsored-avatar {
  width: 70px;
  flex-shrink: 0;
  text-align: center;
  font-size: 9px;
  letter-spacing: 0.1em;
  color: var(--blue);
}
.sponsored-avatar img {
  width: 55px;
  height: 55px;
  margin: 0 auto 6px;
  filter: brightness(0) saturate(100%) invert(57%) sepia(78%) saturate(749%)
    hue-rotate(155deg);
}
.sponsored-avatar.girl {
  color: #d966d6;
}
.sponsored-avatar.girl img {
  filter: none;
}
.sponsored-content {
  flex: 1;
  min-width: 0;
}
.sponsored-top {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}
.sponsored-top h3 {
  font-size: 16px;
  font-weight: 500;
  margin: 0;
}
.sponsored-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}
.sponsored-actions .button {
  font-size: 12px;
  min-height: 33px;
  padding: 5px 16px;
}
.gift-status {
  font-size: 10px;
  color: var(--red);
  font-weight: 700;
}
.gift-status.delivered {
  color: #658b28;
}
.sponsored-description {
  font-size: 10px;
  color: #666;
  margin: 7px 0;
}
.sponsored-meta {
  font-size: 10px;
  font-weight: 600;
  margin: 0;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
/* Dialog nativo: foco contido, Escape, fecho exterior e retorno do foco. */
#modal {
  border: 0;
  border-radius: 30px;
  padding: 36px;
  box-shadow: 0 8px 40px #0001;
  width: min(560px, calc(100% - 36px));
  max-height: calc(100svh - 48px);
  color: var(--navy);
  margin: auto;
  overflow: auto;
  animation: modal-in 0.18s ease-out;
}
#modal::backdrop {
  background: #e1e1e1aa;
}
#modal h2 {
  font-size: 21px;
  margin-bottom: 18px;
}
#modal p {
  font-size: 14px;
  line-height: 1.4;
  margin-bottom: 15px;
}
.modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 28px;
  flex-wrap: wrap;
}
.modal-actions .button {
  flex-grow: 1;
}
.modal-actions .button:only-child {
  flex-grow: 0;
}
.modal-label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 20px 0;
  font-size: 14px;
}
.modal-input {
  width: 100%;
  padding: 12px;
  border: 1px solid #b0b7c5;
  border-radius: 9px;
  color: var(--navy);
}
.consent-label {
  display: flex;
  gap: 9px;
  align-items: center;
  font-weight: 600;
  font-size: 13px;
  margin: 25px 0 12px;
}
.consent-label input {
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}
.consent-copy {
  font-size: 12px !important;
}
.modal-child {
  margin-top: 26px;
}
.modal-child h3 {
  font-size: 26px;
  font-weight: 500;
  margin-bottom: 22px;
}
.modal-child-details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.modal-summary {
  list-style: none;
  padding: 0;
  font-size: 14px;
}
.modal-note {
  font-size: 11px !important;
  color: #777;
}
.modal-close {
  float: right;
  border: 0;
  background: var(--gray);
  border-radius: 50%;
  width: 30px;
  height: 30px;
  font-size: 20px;
  margin: -16px -16px 0 10px;
}
.warning-modal {
  text-align: center;
}
.warning-modal .modal-actions {
  justify-content: center;
}
.warning-modal .button {
  flex: 0 auto;
}
.modal-error {
  font-size: 12px;
  color: var(--red);
}
@keyframes modal-in {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
@media (max-width: 1050px) {
  .filters-panel {
    padding: 28px;
  }
  .filters-grid {
    gap: 12px;
    grid-template-columns: 1.3fr 1.4fr 1fr 1fr;
  }
  .institution-filter > div {
    gap: 5px;
  }
  .institution-filter img {
    width: 30px;
  }
  .child-header {
    padding: 20px 14px;
    gap: 10px;
  }
  .child-header img {
    width: 47px;
  }
  .child-header h3 {
    font-size: 16px;
  }
  .child-body {
    padding: 20px 15px;
  }
  .children-grid {
    gap: 17px;
  }
  .available-count {
    padding: 12px;
    gap: 7px;
  }
  .available-count strong {
    font-size: 39px;
  }
}
@media (max-width: 800px) {
  .filters-grid {
    grid-template-columns: 1fr 1fr;
  }
  .gender {
    min-height: 100px;
  }
  .selected-location h1 strong {
    display: block;
    margin: 0;
  }
  .children-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px;
  }
  .child-header {
    padding: 24px;
  }
  .child-header img {
    width: 65px;
  }
  .child-body {
    padding: 22px;
  }
  .sponsorship-heading {
    padding: 24px;
  }
  .sponsorship-heading h2 {
    font-size: 14px;
  }
  .sponsorship-heading > span {
    font-size: 12px;
  }
  .sponsored-list {
    padding: 24px 20px 0;
  }
  .sponsored-actions {
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
  }
  .sponsored-row {
    gap: 12px;
    padding: 16px;
  }
  .sponsored-top {
    align-items: flex-start;
  }
  .sponsored-meta {
    font-size: 9px;
  }
  .sponsored-description {
    font-size: 9px;
  }
  .sponsored-avatar {
    width: 50px;
  }
}
@media (max-width: 480px) {
  .filters-panel {
    margin-block: 30px;
    padding: 22px 18px;
    border-radius: 20px;
  }
  .selected-location {
    align-items: flex-start;
    gap: 10px;
  }
  .selected-location h1 {
    font-size: 11px;
  }
  .selected-location .button {
    font-size: 10px;
    padding: 7px 10px;
    min-height: 32px;
    white-space: nowrap;
  }
  .filters-grid {
    gap: 12px;
  }
  .gender {
    font-size: 12px;
  }
  .age-filter legend {
    font-size: 10px;
  }
  .available-count strong {
    font-size: 40px;
  }
  .institution-filter {
    padding: 14px;
  }
  .institution-filter > span {
    font-size: 11px;
  }
  .children-grid {
    gap: 14px;
  }
  .child-header {
    padding: 18px 12px;
    gap: 9px;
    min-height: 85px;
  }
  .child-header img {
    width: 42px;
    height: 45px;
  }
  .child-header h3 {
    font-size: 13px;
  }
  .child-header p {
    font-size: 11px;
  }
  .child-body {
    padding: 18px 13px 13px;
  }
  .child-detail {
    font-size: 10px;
    gap: 9px;
    min-height: 40px;
  }
  .child-detail img {
    width: 20px;
    height: 23px;
  }
  .child-detail strong {
    font-size: 9px;
  }
  .child-card {
    border-radius: 20px;
  }
  .child-card .button {
    font-size: 10px;
    min-height: 35px;
    padding: 7px 3px;
  }
  .carousel h2 {
    font-size: 15px;
    margin-left: 0;
  }
  .sponsorship-panel {
    margin-top: 35px;
    padding-bottom: 20px;
  }
  .sponsorship-heading {
    padding: 20px;
    display: block;
    border-radius: 20px;
  }
  .sponsorship-heading h2 {
    font-size: 13px;
    margin-bottom: 12px;
  }
  .sponsorship-heading > span {
    display: inline-block;
    font-size: 11px;
  }
  .sponsored-list {
    padding: 20px 12px 0;
  }
  .sponsored-row {
    padding: 16px 12px;
    gap: 10px;
  }
  .sponsored-avatar {
    width: 35px;
  }
  .sponsored-avatar img {
    height: 40px;
    width: 35px;
  }
  .sponsored-avatar span {
    font-size: 7px;
  }
  .sponsored-top {
    display: block;
  }
  .sponsored-top h3 {
    font-size: 14px;
  }
  .sponsored-actions {
    justify-content: flex-start;
    margin-top: 8px;
  }
  .gift-status {
    font-size: 8px;
  }
  .sponsored-actions .button {
    font-size: 9px;
    min-height: 28px;
    padding: 4px 9px;
  }
  .sponsored-meta {
    font-size: 8px;
  }
  #modal {
    padding: 30px 25px;
    border-radius: 24px;
  }
  #modal h2 {
    font-size: 18px;
  }
  .modal-child-details {
    gap: 10px;
  }
  .modal-actions {
    gap: 10px;
  }
  .modal-actions .button {
    font-size: 12px;
    padding-inline: 14px;
  }
}
.gift-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.gift-status img {
  width: 17px;
  height: 19px;
  filter: invert(25%) sepia(70%) saturate(2080%) hue-rotate(320deg);
}
.gift-status.delivered img {
  filter: invert(55%) sepia(45%) saturate(660%) hue-rotate(32deg);
}
/* Um eixo visual comum com dois controlos de intervalo acessíveis por teclado. */
.ranges {
  position: relative;
  padding-top: 33px;
  height: 56px;
  justify-content: space-between;
}
.ranges::before {
  content: "";
  position: absolute;
  top: 19px;
  left: 0;
  right: 0;
  height: 4px;
  background: #7b88aa;
}
.ranges label {
  width: auto;
}
.ranges input {
  appearance: none;
  -webkit-appearance: none;
  position: absolute;
  inset: 9px 0 auto;
  width: 100%;
  height: 24px;
  margin: 0;
  background: transparent;
  pointer-events: none;
}
.ranges input::-webkit-slider-runnable-track {
  background: transparent;
  height: 4px;
}
.ranges input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  pointer-events: auto;
  cursor: pointer;
  width: 23px;
  height: 23px;
  margin-top: -10px;
  border-radius: 50%;
  background: linear-gradient(90deg, #c6cede, #183d68);
  box-shadow: 0 1px 3px #0003;
}
.ranges input::-moz-range-track {
  background: transparent;
  height: 4px;
}
.ranges input::-moz-range-thumb {
  pointer-events: auto;
  cursor: pointer;
  width: 23px;
  height: 23px;
  border: 0;
  border-radius: 50%;
  background: #2b527a;
}
