/* Account card modal source-of-truth. Keep card/address/review/status modal chrome here. */

.account-card-modal {
  position: fixed;
  z-index: var(--bodycare-z-account-card-modal, 1300);
  inset: 0;
  box-sizing: border-box;
  display: grid;
  place-items: center;
  padding: 24px;
  overflow-y: auto;
}

.account-card-modal[hidden] {
  display: none;
}

.account-card-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: var(--bc-modal-overlay, rgba(16, 14, 18, .48));
  backdrop-filter: blur(2px) saturate(1.04);
  -webkit-backdrop-filter: blur(2px) saturate(1.04);
  cursor: pointer;
}

.account-card-modal__panel {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: min(520px, calc(100% - 32px));
  margin: 0 auto;
  padding: 24px;
  overflow: hidden;
  border: 1px solid var(--bc-modal-border, rgba(17, 17, 17, .11));
  border-radius: var(--bc-modal-radius, 8px);
  background: var(--bc-modal-surface, #fff);
  box-shadow: var(--bc-modal-shadow, 0 28px 80px rgba(31, 23, 30, .2), 0 10px 30px rgba(31, 23, 30, .08));
  color: var(--bc-modal-text, #17131a);
  outline: 0;
}

.account-card-modal__panel::before {
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-active, var(--pink-dark)));
  content: "";
}

.account-card-modal__panel h2 {
  margin: 0;
  color: var(--bc-modal-text, #17131a);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 1.12;
  text-transform: none;
}

.account-card-modal__close {
  position: absolute;
  top: 20px;
  right: 20px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 0;
  border-radius: var(--bc-modal-radius, 8px);
  background: transparent;
  color: #2b2530;
  cursor: pointer;
  box-shadow: none;
  transition: background .18s ease, color .18s ease;
}

.account-card-modal__close:hover,
.account-card-modal__close:focus-visible {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  outline: 0;
}

.account-card-modal__close svg {
  width: 22px;
  height: 22px;
}

.account-card-modal__panel.review-modal__panel {
  width: min(680px, calc(100% - 32px));
  max-height: calc(100svh - 48px);
  overflow: auto;
}

.account-card-modal__panel.account-status-modal__panel {
  width: min(640px, calc(100% - 32px));
  max-height: calc(100svh - 48px);
  overflow: auto;
}

.review-modal .account-form-actions {
  position: sticky;
  bottom: 0;
  margin-right: -24px;
  margin-left: -24px;
  padding: 14px 24px 18px;
  border-top: 1px solid var(--bc-modal-border, rgba(17, 17, 17, .11));
  border-radius: 0;
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.account-card-modal__panel .account-note {
  margin: 14px 0;
  border: 1px solid var(--bc-modal-soft-border, rgba(var(--theme-accent-rgb), .16));
  border-radius: var(--bc-modal-radius, 8px);
  background: var(--bc-modal-muted-surface, color-mix(in srgb, var(--pink-soft) 68%, #ffffff));
  box-shadow: none;
}

.account-address-modal__panel {
  width: min(560px, calc(100% - 32px));
  max-height: calc(100svh - 40px);
  overflow: auto;
}

.account-modal-form {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.account-modal-form label {
  display: grid;
  min-width: 0;
  gap: 6px;
  color: #475569;
  font-weight: 800;
}

.account-modal-form input,
.account-modal-form select {
  box-sizing: border-box;
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--bc-modal-control, #dfe3ea);
  border-radius: var(--bc-modal-radius, 8px);
  padding: 0 12px;
  font: inherit;
  color: #0f172a;
  background-color: #fff;
  box-shadow: none;
}

.account-modal-form input:focus,
.account-modal-form select:focus {
  border-color: var(--color-primary);
  box-shadow: var(--bc-modal-focus, 0 0 0 3px rgba(var(--theme-accent-rgb), .12));
  outline: 0;
}

.account-modal-form select {
  appearance: none;
  padding-right: 38px;
  background-image:
    linear-gradient(45deg, transparent 50%, #64748b 50%),
    linear-gradient(135deg, #64748b 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

.address-phone-field {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  min-height: 44px;
  overflow: hidden;
  border: 1px solid var(--account-line);
  border-radius: 8px;
  background: #fff;
}

.address-phone-field:focus-within {
  border-color: var(--account-pink);
  box-shadow: 0 0 0 3px rgba(236, 45, 136, .1);
}

.address-phone-field:has(input.is-invalid) {
  border-color: #e11d48;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, .08);
}

.address-phone-field__prefix {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 0 14px;
  border-right: 1px solid var(--account-line);
  color: #0f172a;
}

.address-phone-field__prefix img {
  width: 30px;
  height: 22px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 0 0 0 1px rgba(15, 23, 42, .12);
}

.address-phone-field__prefix strong {
  font-weight: 800;
}

.account-modal-form .address-phone-field input {
  min-height: 42px;
  border: 0;
  border-radius: 0;
  padding: 0 14px;
  background: transparent;
  box-shadow: none;
}

.account-modal-form .address-phone-field input:focus {
  outline: 0;
}

.account-modal-form .address-phone-field input.is-invalid {
  box-shadow: none;
}

.address-location-picker {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr) auto 38px;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid #dbe6f2;
  border-radius: 8px;
  background: #f8fbff;
}

.address-location-picker__icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 999px;
  background: #ffe7f2;
  color: var(--account-pink);
}

.address-location-picker strong,
.address-location-picker small {
  display: block;
}

.address-location-picker strong {
  color: #0f172a;
  font-size: 14px;
}

.address-location-picker small {
  margin-top: 2px;
  color: #64748b;
  font-size: 12px;
  font-weight: 800;
}

.address-location-picker .account-btn {
  min-height: 38px;
  padding: 0 12px;
  white-space: nowrap;
}

.address-location-picker__clear {
  width: 38px;
  min-width: 38px;
  padding: 0;
}

.address-location-picker.is-selected {
  border-color: #b7e4cc;
  background: #f3fff8;
}

.address-location-picker.is-selected .address-location-picker__icon {
  background: #dcfce7;
  color: #128451;
}

.address-map-modal__panel {
  width: min(860px, calc(100% - 32px));
  max-height: calc(100svh - 32px);
  overflow: auto;
}

.address-map-modal__panel > p {
  margin: 8px 44px 16px 0;
  color: #64748b;
  font-weight: 700;
}

.review-modal__panel > p {
  margin: 6px 46px 18px 0;
  color: var(--account-muted);
}

.address-map-modal__search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.address-map-modal__search label {
  display: grid;
  gap: 6px;
  margin: 0;
}

.address-map-modal__search label span {
  color: #64748b;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.address-map-modal__search input {
  width: 100%;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid #dbe6f2;
  border-radius: 8px;
  background: #fff;
  color: #1f2937;
  font: inherit;
  font-weight: 800;
  outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}

.address-map-modal__search input:focus {
  border-color: #f472b6;
  box-shadow: 0 0 0 3px rgba(244, 114, 182, .16);
}

.address-map-modal__search > small {
  grid-column: 1 / -1;
  color: #64748b;
  font-weight: 800;
}

.address-map-modal__search > small.is-error {
  color: #e11d48;
}

.address-map-modal__canvas {
  height: min(62svh, 560px);
  min-height: 360px;
  overflow: hidden;
  border: 1px solid #dbe6f2;
  border-radius: 8px;
  background: #eef5fb;
}

.address-map-modal__error {
  display: grid;
  place-items: center;
  min-height: inherit;
  padding: 28px;
  color: #b91c1c;
  font-weight: 900;
  line-height: 1.4;
  text-align: center;
}

.address-map-modal__actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(160px, .85fr);
  align-items: stretch;
  gap: 10px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #e6edf5;
}

.account-card-modal .address-map-modal__actions .account-btn {
  display: inline-flex;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 14px;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.18;
  text-align: center;
  white-space: normal;
}

.account-card-modal .address-map-modal__actions .account-btn svg {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.account-card-modal .address-map-modal__actions .account-btn--primary {
  background: linear-gradient(135deg, var(--color-primary), var(--color-primary-hover));
}

.address-map-modal .leaflet-container {
  font: inherit;
}

.address-map-modal__canvas .leaflet-tile {
  max-width: none;
}

.address-map-modal__canvas .leaflet-control-container a {
  color: inherit;
}

.address-map-modal__canvas .leaflet-control-attribution {
  font-size: 11px;
}

.pac-container {
  z-index: var(--bodycare-z-autocomplete, 100000);
  border-radius: 8px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, .18);
}

.account-modal-form__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

.account-modal-form input.is-invalid,
.account-modal-form select.is-invalid {
  border-color: #e11d48;
  box-shadow: 0 0 0 3px rgba(225, 29, 72, .08);
}

.account-form-error {
  margin: 0;
  color: #e11d48;
  font-size: 13px;
  font-weight: 800;
}

.account-card-modal .account-btn--primary {
  min-height: 48px;
  border: 1px solid var(--color-primary);
  border-radius: var(--bc-modal-radius, 8px);
  background: var(--color-primary);
  color: #ffffff;
  box-shadow: 0 12px 24px rgba(var(--theme-accent-rgb), .2);
  transform: none;
}

.account-card-modal .account-btn--primary:hover,
.account-card-modal .account-btn--primary:focus-visible {
  border-color: var(--color-primary-hover);
  background: var(--color-primary-hover);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(var(--theme-accent-rgb), .24);
  outline: 0;
}

.account-card-modal .account-btn:not(.account-btn--primary) {
  min-height: 44px;
  border: 1px solid rgba(var(--theme-accent-rgb), .34);
  border-radius: var(--bc-modal-radius, 8px);
  background: #ffffff;
  color: var(--color-primary);
  box-shadow: none;
}

.account-card-modal .account-btn:not(.account-btn--primary):hover,
.account-card-modal .account-btn:not(.account-btn--primary):focus-visible {
  background: var(--color-primary-soft);
  color: var(--color-primary);
  outline: 0;
}

.status-levels {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 16px 0 18px;
}

.status-levels button {
  display: grid;
  grid-template-rows: auto 1fr auto;
  min-height: 124px;
  gap: 10px;
  padding: 14px 13px;
  overflow: hidden;
  border: 1px solid var(--account-line);
  border-radius: 8px;
  background: #fff;
  color: var(--account-ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, box-shadow .18s ease, transform .18s ease;
}

.status-levels button:hover,
.status-levels button:focus-visible {
  border-color: rgba(var(--theme-accent-rgb), .38);
  background: color-mix(in srgb, var(--account-pink-soft) 72%, #ffffff);
  box-shadow: 0 10px 24px rgba(var(--theme-accent-rgb), .10);
}

.status-levels button:focus-visible {
  outline: 2px solid rgba(var(--theme-accent-rgb), .30);
  outline-offset: 2px;
}

.status-levels button.is-active {
  border-color: rgba(var(--theme-accent-rgb), .44);
  background: var(--account-pink-soft);
}

.status-levels strong,
.status-levels small,
.status-levels b {
  display: block;
  min-width: 0;
}

.status-levels strong {
  overflow: hidden;
  color: var(--account-ink);
  font-size: 15px;
  font-weight: 900;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-levels small {
  align-self: center;
  color: var(--account-muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.25;
}

.status-levels b {
  align-self: end;
  color: var(--account-pink);
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
}

@media (max-width: 760px) {
  .status-levels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 901px) and (max-width: 1279px) {
  .account-modal-form__row {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .account-card-modal {
    padding: 16px;
  }

  .account-card-modal__panel {
    width: min(100%, calc(100vw - 28px));
    padding: 20px;
  }
}

@media (max-width: 560px) {
  .address-location-picker {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
  }

  .address-location-picker > .account-btn:not(.address-location-picker__clear) {
    grid-column: 1 / -1;
  }

  .address-map-modal__search {
    grid-template-columns: minmax(0, 1fr);
  }

  .address-map-modal__search .account-btn {
    width: 100%;
  }

  .address-map-modal__canvas {
    min-height: 320px;
  }

  .address-map-modal__actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
    margin-top: 12px;
    padding-top: 12px;
  }

  .account-card-modal .address-map-modal__actions .account-btn {
    min-height: 46px;
    padding: 0 10px;
    font-size: 13.5px;
  }

  .account-card-modal .address-map-modal__actions .account-btn--primary {
    grid-column: 1 / -1;
    min-height: 50px;
  }

  .status-levels {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 360px) {
  .address-map-modal__actions {
    grid-template-columns: 1fr;
  }

  .account-card-modal .address-map-modal__actions .account-btn--primary {
    grid-column: auto;
  }
}
