/* =========================================================
   Account Addresses
   ========================================================= */

.account-addresses-page {
  min-height: 70vh;
  padding-bottom: 34px;
  background: #f5f6fb;
}


/* =========================================================
   Hero
   ========================================================= */

.account-addresses-hero {
  padding: 46px 0 28px;
}

.account-addresses-hero__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;

  padding: 42px 46px;
  border: 1px solid rgba(46, 47, 121, 0.12);
  border-radius: 32px;

  background:
    radial-gradient(
      circle at 90% 18%,
      rgba(77, 83, 159, 0.24),
      transparent 34%
    ),
    radial-gradient(
      circle at 8% 10%,
      rgba(46, 47, 121, 0.15),
      transparent 30%
    ),
    linear-gradient(
      135deg,
      #f8f9ff 0%,
      #eef0fb 48%,
      #f7f8fc 100%
    );

  box-shadow:
    0 26px 64px rgba(31, 25, 84, 0.11);
}

.account-addresses-eyebrow {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--primary);
  font-size: 12px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.account-addresses-hero h1 {
  margin: 0 0 12px;
  color: var(--primary-dark);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
  letter-spacing: -0.045em;
}

.account-addresses-hero p {
  max-width: 720px;
  margin: 0;
  color: #686d84;
  font-size: 16px;
  line-height: 1.7;
}

.account-addresses-hero__actions {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 0 0 auto;
}

.account-addresses-back-link {
  color: var(--primary);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.account-addresses-back-link:hover {
  text-decoration: underline;
}


/* =========================================================
   Section
   ========================================================= */

.account-addresses-section {
  padding: 10px 0 72px;
}

.account-addresses-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.account-addresses-section__head > div:first-child {
  min-width: 0;
}

.account-addresses-section__head span {
  display: block;
  margin-bottom: 6px;
  color: #777b91;
  font-size: 11px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.account-addresses-section__head h2 {
  margin: 0;
  color: #1b2144;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: -0.03em;
}

.account-addresses-section__head p {
  max-width: 680px;
  margin: 8px 0 0;
  color: #6b6f89;
  font-size: 14px;
  line-height: 1.65;
}

.account-addresses-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 8px 13px;
  border: 1px solid #d9dcf0;
  border-radius: 999px;
  color: #4d539f;
  background: #eef0ff;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.account-addresses-message {
  display: none;
  margin-bottom: 20px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.5;
}

.account-addresses-message.is-visible {
  display: block;
}

.account-addresses-message.is-success {
  color: #247443;
  background: #e9f8ef;
  border: 1px solid #bfe7cd;
}

.account-addresses-message.is-error {
  color: #a22a2a;
  background: #fff0f0;
  border: 1px solid #efc2c2;
}


/* =========================================================
   Grid
   ========================================================= */

.account-addresses-grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 22px;
}

.account-address-card {
  display: flex;
  flex-direction: column;
  min-height: 100%;

  padding: 24px;
  border: 1px solid rgba(31, 25, 84, 0.1);
  border-radius: 22px;

  background: #ffffff;

  box-shadow:
    0 16px 42px rgba(31, 25, 84, 0.08);

  transition:
    transform 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.account-address-card:hover {
  transform: translateY(-2px);
  border-color: rgba(77, 83, 159, 0.22);
  box-shadow:
    0 22px 48px rgba(31, 25, 84, 0.11);
}

.account-address-card.is-default {
  border-color: rgba(77, 83, 159, 0.28);
  background:
    linear-gradient(
      180deg,
      #ffffff 0%,
      #fbfbff 100%
    );
}

.account-address-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.account-address-card__title {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.account-address-card__title > .material-icons {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  color: #ffffff;
  background:
    linear-gradient(
      135deg,
      #1f1954,
      #4d539f
    );
  box-shadow:
    0 8px 18px rgba(31, 25, 84, 0.16);
  font-size: 21px;
}

.account-address-card__title > div {
  min-width: 0;
}

.account-address-card__title strong {
  display: block;
  color: #1b2144;
  font-size: 16px;
  line-height: 1.3;
  overflow-wrap: anywhere;
}

.account-address-card__default {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 5px;
  padding: 5px 9px;
  border: 1px solid #cfd3f5;
  border-radius: 999px;
  color: #4d539f;
  background: #eef0ff;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account-address-card__menu-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;

  border: 0;
  border-radius: 10px;

  color: #8b8ea4;
  background: transparent;
}

.account-address-card__menu-button .material-icons {
  font-size: 20px;
}

.account-address-card__details {
  display: grid;
  gap: 4px;
  margin: 0 0 24px;
  color: #5f6379;
  font-size: 14px;
  font-style: normal;
  line-height: 1.55;
}

.account-address-card__details strong {
  margin-bottom: 2px;
  color: #1b2144;
  font-size: 15px;
}

.account-address-card__phone {
  margin-top: 6px;
  color: #4d539f;
  font-weight: 700;
}

.account-address-card__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: auto;
  padding-top: 18px;
  border-top: 1px solid #eceef5;
}

.account-address-action {
  min-height: 34px;
  padding: 7px 11px;

  border: 1px solid #d9dcf0;
  border-radius: 10px;

  color: #4d539f;
  background: #ffffff;

  font: inherit;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;

  cursor: pointer;

  transition:
    color 0.2s ease,
    background 0.2s ease,
    border-color 0.2s ease;
}

.account-address-action:hover {
  color: #1f1954;
  background: #f5f6fb;
  border-color: #c8cce6;
}

.account-address-action--default {
  color: #247443;
  border-color: #bfe7cd;
  background: #f4fbf6;
}

.account-address-action--default:hover {
  color: #185c31;
  border-color: #9fd4b1;
  background: #e9f8ef;
}

.account-address-action--delete {
  margin-left: auto;
  color: #a22a2a;
  border-color: #efc2c2;
  background: #fffafa;
}

.account-address-action--delete:hover {
  color: #861e1e;
  border-color: #e8aaaa;
  background: #fff0f0;
}


/* =========================================================
   Empty state
   ========================================================= */

.account-addresses-empty {
  padding: 54px 28px;
  border: 1px solid rgba(31, 25, 84, 0.1);
  border-radius: 24px;
  text-align: center;
  background: #ffffff;
  box-shadow:
    0 16px 42px rgba(31, 25, 84, 0.08);
}

.account-addresses-empty__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  margin: 0 auto;
  border-radius: 20px;
  color: #ffffff;
  background:
    linear-gradient(
      135deg,
      #1f1954,
      #4d539f
    );
  box-shadow:
    0 12px 26px rgba(31, 25, 84, 0.18);
}

.account-addresses-empty__icon .material-icons {
  font-size: 30px;
}

.account-addresses-empty h2 {
  margin: 20px 0 8px;
  color: #1b2144;
  font-size: 24px;
}

.account-addresses-empty p {
  max-width: 520px;
  margin: 0 auto 24px;
  color: #6b6f89;
  font-size: 14px;
  line-height: 1.65;
}


/* =========================================================
   Modal
   ========================================================= */

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

.account-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;

  display: flex;
  align-items: center;
  justify-content: center;

  padding: 24px;
}

.account-modal__backdrop {
  position: absolute;
  inset: 0;

  background:
    rgba(13, 16, 37, 0.62);

  backdrop-filter: blur(4px);
}

.account-modal__dialog {
  position: relative;
  z-index: 1;

  width: min(760px, 100%);
  max-height: calc(100vh - 48px);
  overflow-y: auto;

  border: 1px solid rgba(31, 25, 84, 0.12);
  border-radius: 24px;

  background: #ffffff;

  box-shadow:
    0 30px 90px rgba(13, 16, 37, 0.28);
}

.account-modal--small
.account-modal__dialog {
  width: min(460px, 100%);
}

.account-modal__header {
  position: sticky;
  top: 0;
  z-index: 2;

  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;

  padding: 24px 26px;
  border-bottom: 1px solid #e5e7f2;

  background:
    rgba(255, 255, 255, 0.97);

  backdrop-filter: blur(8px);
}

.account-modal__header > div > span {
  display: block;
  margin-bottom: 5px;
  color: #777b91;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.account-modal__header h2 {
  margin: 0;
  color: #1b2144;
  font-size: 24px;
  line-height: 1.2;
}

.account-modal__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;

  border: 1px solid #d9dcf0;
  border-radius: 11px;

  color: #4d539f;
  background: #ffffff;

  cursor: pointer;

  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.account-modal__close:hover {
  background: #f5f6fb;
  border-color: #c8cce6;
}

.account-modal__close .material-icons {
  font-size: 20px;
}

.account-modal__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;

  padding: 20px 26px;
  border-top: 1px solid #e5e7f2;

  background: #fbfbfe;
}


/* =========================================================
   Address form
   ========================================================= */

.account-address-form {
  display: block;
}

.account-address-form__grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 18px;

  padding: 26px;
}

.account-address-form .form-group {
  display: grid;
  gap: 8px;
}

.account-address-form .form-group--full {
  grid-column: 1 / -1;
}

.account-address-form label {
  color: #1b2144;
  font-size: 13px;
  font-weight: 800;
}

.account-address-form input,
.account-address-form select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;

  border: 1px solid #d7daea;
  border-radius: 12px;

  color: #1b2144;
  background: #ffffff;

  font: inherit;
  font-size: 14px;

  outline: none;

  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.account-address-form input:focus,
.account-address-form select:focus {
  border-color: #4d539f;
  box-shadow:
    0 0 0 4px rgba(77, 83, 159, 0.12);
}

.account-address-form input:-webkit-autofill,
.account-address-form input:-webkit-autofill:hover,
.account-address-form input:-webkit-autofill:focus,
.account-address-form select:-webkit-autofill {
  -webkit-text-fill-color: #1b2144;
  -webkit-box-shadow:
    0 0 0 1000px #ffffff inset;
  transition:
    background-color 9999s ease-out 0s;
}

.form-label-optional {
  margin-left: 4px;
  color: #8b8ea4;
  font-size: 11px;
  font-weight: 600;
}

.account-address-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 12px 14px;

  border: 1px solid #e0e3f0;
  border-radius: 12px;

  color: #4d5272;
  background: #f8f9fd;

  cursor: pointer;
}

.account-address-checkbox input {
  width: 18px;
  min-height: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.account-address-checkbox span {
  color: #4d5272;
  font-size: 13px;
  font-weight: 700;
}

.account-address-form__message {
  display: none;
  margin: 0 26px 22px;
  padding: 13px 15px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

.account-address-form__message.is-visible {
  display: block;
}

.account-address-form__message.is-error {
  color: #a22a2a;
  background: #fff0f0;
  border: 1px solid #efc2c2;
}

.account-address-form__message.is-success {
  color: #247443;
  background: #e9f8ef;
  border: 1px solid #bfe7cd;
}


/* =========================================================
   Delete modal
   ========================================================= */

.account-delete-address {
  padding: 28px 26px 18px;
  text-align: center;
}

.account-delete-address__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 62px;
  height: 62px;
  margin: 0 auto 18px;

  border-radius: 19px;

  color: #a22a2a;
  background: #fff0f0;
  border: 1px solid #efc2c2;
}

.account-delete-address__icon .material-icons {
  font-size: 29px;
}

.account-delete-address p {
  margin: 0;
  color: #5f6379;
  font-size: 14px;
  line-height: 1.65;
}

.account-delete-address p + p {
  margin-top: 8px;
}

.account-delete-address strong {
  color: #1b2144;
}

.account-delete-button {
  color: #ffffff;
  background: #b42323;
  border-color: #b42323;
}

.account-delete-button:hover {
  background: #941c1c;
  border-color: #941c1c;
}


/* =========================================================
   Address validation modal
   ========================================================= */

.account-modal--validation .account-modal__dialog {
  width: min(820px, 100%);
}

.account-address-validation {
  padding: 26px;
}

.account-address-validation__intro {
  max-width: 660px;
  margin: 0 0 22px;
  color: #5f6379;
  font-size: 14px;
  line-height: 1.65;
}

.account-address-validation__grid {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.account-address-validation__option {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100%;
  padding: 22px;
  border: 1px solid #dfe2ef;
  border-radius: 18px;
  background: #f8f9fd;
}

.account-address-validation__option--recommended {
  border-color: rgba(77, 83, 159, 0.34);
  background:
    linear-gradient(
      180deg,
      #f4f5ff 0%,
      #fafaff 100%
    );
}

.account-address-validation__badge {
  position: absolute;
  top: 15px;
  right: 15px;
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  color: #ffffff;
  background: #4d539f;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.account-address-validation__label {
  display: block;
  margin-bottom: 12px;
  color: #777b91;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.account-address-validation__address {
  min-height: 118px;
  margin-bottom: 20px;
  color: #1b2144;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.7;
  white-space: pre-line;
}

.account-address-validation__option .btn {
  width: 100%;
  margin-top: auto;
}


/* =========================================================
   Tablet
   ========================================================= */

@media (max-width: 900px) {
  .account-addresses-hero__inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-addresses-hero__actions {
    width: 100%;
  }

  .account-addresses-grid {
    grid-template-columns: 1fr;
  }
}


/* =========================================================
   Mobile
   ========================================================= */

@media (max-width: 640px) {
  .account-addresses-page {
    padding-bottom: 20px;
  }

  .account-addresses-hero {
    padding: 28px 0 22px;
  }

  .account-addresses-hero__inner {
    gap: 24px;
    padding: 28px 24px;
    border-radius: 24px;
  }

  .account-addresses-hero h1 {
    font-size: clamp(31px, 10vw, 42px);
  }

  .account-addresses-hero p {
    font-size: 14px;
  }

  .account-addresses-hero__actions {
    align-items: stretch;
    flex-direction: column;
    gap: 14px;
  }

  .account-addresses-back-link {
    text-align: center;
  }

  .account-addresses-hero__actions .btn {
    width: 100%;
  }

  .account-addresses-section {
    padding: 8px 0 50px;
  }

  .account-addresses-section__head {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .account-address-card {
    padding: 20px;
    border-radius: 18px;
  }

  .account-address-card__actions {
    align-items: stretch;
    flex-direction: column;
  }

  .account-address-action {
    width: 100%;
  }

  .account-address-action--delete {
    margin-left: 0;
  }

  .account-modal {
    align-items: flex-end;
    padding: 0;
  }

  .account-modal__dialog {
    width: 100%;
    max-height: 94vh;
    border-radius: 24px 24px 0 0;
  }

  .account-modal--small
  .account-modal__dialog {
    width: 100%;
  }

  .account-modal__header {
    padding: 21px 20px;
  }

  .account-modal__header h2 {
    font-size: 21px;
  }

  .account-address-form__grid {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 22px 20px;
  }

  .account-address-form
  .form-group--full {
    grid-column: auto;
  }

  .account-address-form__message {
    margin: 0 20px 18px;
  }

  .account-modal__footer {
    align-items: stretch;
    flex-direction: column-reverse;
    padding: 18px 20px 22px;
  }

  .account-modal__footer .btn {
    width: 100%;
  }

  .account-delete-address {
    padding: 26px 20px 16px;
  }

  .account-address-validation {
    padding: 22px 20px;
  }

  .account-address-validation__grid {
    grid-template-columns: 1fr;
  }

  .account-address-validation__option {
    padding: 19px;
  }

  .account-address-validation__address {
    min-height: auto;
  }
}