/* Suscripción a alertas. Una definición por componente y contexto responsive. */

body {
  background: var(--paper);
}

.alerts-shell {
  width: min(1200px, 92vw);
  margin: 48px auto 72px;
}

.alerts-intro {
  max-width: 800px;
  margin: 0 auto 36px;
  text-align: center;
}

.alerts-intro h1 {
  margin-bottom: 20px;
  font-size: clamp(34px, 4vw, 52px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: -1.5px;
}

.alerts-intro h1 span {
  color: #a63f2d;
  text-decoration: underline;
  text-decoration-color: var(--sun);
  text-decoration-thickness: 6px;
  text-underline-offset: 5px;
}

.alerts-description {
  max-width: 690px;
  margin: 0 auto 12px;
  font-size: 16px;
  line-height: 1.8;
  text-wrap: pretty;
}

.alerts-schedule {
  margin: 0;
  font-size: 13px;
  line-height: 1.8;
  color: #625662;
}

.alerts-schedule strong {
  color: var(--ink);
}

.alerts-panel {
  border: 2px solid var(--ink);
  background: var(--paper);
  box-shadow: 6px 6px 0 #ac91a5;
}

.alerts-panel .window-bar {
  height: 24px;
  border-bottom-width: 2px;
}

.search-preferences, .subscription-panel {
  padding: 24px 28px;
}

.form-heading {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 8px 16px;
  margin-bottom: 22px;
}

.form-heading h2 {
  margin: 0;
  font-size: 20px;
}

.search-import {
  margin: 0 0 22px;
  padding: 12px 16px;
  border-left: 3px solid var(--plum);
  background: #fff4e1;
  font-size: 14px;
  line-height: 1.7;
}

.inherited-agencies {
  min-width: 0;
  margin: 16px 0 0;
  padding: 0;
  border: 0;
}

.inherited-agencies .field-help {
  margin: 4px 0 10px;
}

.inherited-agencies label, .inherited-agencies span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.filters-menu {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.price-ranges {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 20px;
}

.price-range {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.price-range legend {
  padding: 0;
  margin-bottom: 6px;
  color: var(--plum);
}

.price-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.filter-field {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.filter-label {
  display: block;
  margin-bottom: 0;
}

.filter-field, .filter-label, .price-range legend, .filter-popover legend, .filter-notes .check-field {
  font: 600 14px/1.5 "Space Grotesk", system-ui, sans-serif;
}

.alerts-shell input:not([type=checkbox]), .alerts-shell select, .filter-value {
  width: 100%;
  min-width: 0;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid #766a70;
  border-radius: 4px;
  background: #fffcf8;
  color: var(--ink);
  font: 400 14px/1.45 "Space Grotesk", system-ui, sans-serif;
}

.alerts-shell input::placeholder {
  color: #746874;
  opacity: 1;
}

.alerts-shell select {
  padding-right: 22px;
}

.filter-dropdown {
  position: relative;
  min-width: 0;
}

.filter-dropdown summary {
  list-style: none;
  cursor: pointer;
  border-radius: 4px;
}

.filter-dropdown summary::-webkit-details-marker {
  display: none;
}

.filter-value {
  display: block;
  position: relative;
  height: 46px;
  padding: 0 28px 0 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 44px;
}

.filter-value::after {
  content: "";
  position: absolute;
  right: 13px;
  top: 50%;
  width: 6px;
  height: 6px;
  border-right: 2px solid var(--ink);
  border-bottom: 2px solid var(--ink);
  transform: translateY(-70%) rotate(45deg);
}

.filter-dropdown[open] .filter-value {
  border-color: var(--plum);
  background: #fff4e1;
}

.filter-dropdown[open] .filter-value::after {
  transform: translateY(-30%) rotate(225deg);
}

.alerts-shell .filter-popover {
  position: absolute;
  z-index: 10;
  top: calc(100% + 8px);
  left: 0;
  width: 320px;
  max-width: 84vw;
  margin: 0;
  padding: 18px;
  border: 1px solid #624058;
  border-radius: 4px;
  background: var(--paper);
  box-shadow: 4px 4px 0 #ac91a5;
}

.filter-popover legend {
  float: left;
  width: 100%;
  margin-bottom: 4px;
  padding: 0;
}

.filter-popover .field-help {
  clear: both;
  margin-bottom: 12px;
}

.filter-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-choices label {
  position: relative;
  display: flex;
}

.filter-choices input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

.filter-choices span {
  display: flex;
  align-items: center;
  min-height: 44px;
  border: 1px solid #766a70;
  border-radius: 3px;
  background: #fffcf8;
  padding: 9px 11px;
  font: 400 14px/1.45 "Space Grotesk", system-ui, sans-serif;
  cursor: pointer;
}

.filter-choices input:checked + span {
  background: #ffdc7b;
  border-color: #25283a;
  box-shadow: 1px 2px 0 #ac91a5;
}

.filter-choices input:focus-visible + span {
  outline: 3px solid #5a315b;
  outline-offset: 3px;
}

.filter-notes {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 16px;
}

.check-field {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  min-height: 44px;
  font-size: 14px;
  line-height: 1.7;
}

.check-field input {
  margin: 3px 0 0;
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  accent-color: #624058;
}

.filter-notes .check-field {
  align-items: center;
  font: 500 14px/1.5 "Space Grotesk", system-ui, sans-serif;
}

.filter-notes .check-field input {
  margin: 0;
}

.field-help {
  margin: 0;
  font-size: 12px;
  color: #625662;
  line-height: 1.7;
}

.subscription-panel {
  display: grid;
  gap: 14px;
  border-top: 1px solid #d7c2b4;
  background: #f3eada;
}

.subscription-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto;
  align-items: end;
  gap: 16px;
}

.subscription-row .oga-button {
  margin-bottom: 6px;
  min-width: 190px;
}

.subscription-row .oga-button:disabled {
  cursor: wait;
  opacity: .65;
}

.consent a {
  text-underline-offset: 3px;
}

.alerts-shell #status {
  margin: 0;
}

.alerts-shell .honeypot {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

@media (max-width: 1050px) {
  .filters-menu {
    gap: 16px 12px;
  }

  #subtypes-group .filter-popover, #bedrooms-group .filter-popover {
    left: auto;
    right: 0;
  }
}

@media (max-width: 620px) {
  .alerts-shell {
    margin-top: 28px;
    margin-bottom: 44px;
  }

  .alerts-intro {
    margin-bottom: 26px;
  }

  .alerts-intro h1 {
    letter-spacing: -1px;
  }

  .alerts-description {
    font-size: 14px;
  }

  .alerts-schedule {
    font-size: 12px;
  }

  .search-preferences, .subscription-panel {
    padding: 22px 18px;
  }

  .form-heading {
    gap: 6px;
    flex-direction: column;
    margin-bottom: 18px;
  }

  .form-heading h2 {
    font-size: 18px;
  }

  .filters-menu {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-label {
    min-height: 42px;
  }

  .price-ranges {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .alerts-shell input:not([type=checkbox]), .alerts-shell select, .filter-value {
    font-size: 16px;
  }

  #subtypes-group .filter-popover {
    left: 0;
    right: auto;
  }

  #categories-group .filter-popover, #bedrooms-group .filter-popover {
    left: auto;
    right: 0;
  }

  .subscription-row {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .subscription-row .oga-button {
    width: 100%;
    margin-top: 4px;
  }
}
