/* =========================================================
   Account Profile
   ========================================================= */

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


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

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

.account-profile-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-profile-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-profile-hero h1 {
  margin: 0 0 12px;
  color: var(--primary-dark);
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1;
  letter-spacing: -0.045em;
}

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

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

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

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


/* =========================================================
   Main section
   ========================================================= */

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

.account-profile-layout {
  display: grid;
  grid-template-columns:
    minmax(270px, 0.78fr)
    minmax(0, 1.72fr);
  gap: 26px;
  align-items: start;
}

.account-profile-sidebar,
.account-profile-main {
  display: grid;
  gap: 24px;
}

.account-profile-sidebar {
  position: sticky;
  top: 110px;
}


/* =========================================================
   Shared card
   ========================================================= */

.account-profile-card {
  overflow: hidden;
  padding: 26px;
  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);
}

.account-profile-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.account-profile-card__head > div {
  min-width: 0;
}

.account-profile-card__head 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-profile-card__head h2 {
  margin: 0;
  color: #1b2144;
  font-size: 22px;
  line-height: 1.25;
  letter-spacing: -0.025em;
}

.account-profile-card__head p {
  max-width: 660px;
  margin: 7px 0 0;
  color: #6b6f89;
  font-size: 13px;
  line-height: 1.65;
}

.account-profile-card__eyebrow {
  display: block;
  margin-bottom: 7px;
  color: #4d539f;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}


/* =========================================================
   Page messages
   ========================================================= */

.account-profile-message {
  display: none;
  margin-bottom: 22px;
  padding: 14px 16px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.55;
}

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

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

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


/* =========================================================
   Profile summary
   ========================================================= */

.account-profile-summary {
  position: relative;
  text-align: center;

  background:
    radial-gradient(
      circle at 90% 8%,
      rgba(77, 83, 159, 0.12),
      transparent 30%
    ),
    linear-gradient(
      180deg,
      #ffffff 0%,
      #fbfbff 100%
    );
}

.account-profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 94px;
  height: 94px;
  margin: 0 auto 18px;

  border: 7px solid #ffffff;
  border-radius: 50%;

  color: #ffffff;

  background:
    linear-gradient(
      135deg,
      #1f1954,
      #4d539f
    );

  box-shadow:
    0 15px 32px rgba(31, 25, 84, 0.22);

  font-size: 28px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.04em;
}

.account-profile-summary h2 {
  margin: 0;
  color: #1b2144;
  font-size: 23px;
  line-height: 1.25;
  letter-spacing: -0.025em;
  overflow-wrap: anywhere;
}

.account-profile-summary__company {
  margin: 5px 0 0;
  color: #6b6f89;
  font-size: 13px;
  line-height: 1.5;
}

.account-profile-summary__status {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  margin-top: 14px;
  padding: 6px 11px;

  border: 1px solid #bfe7cd;
  border-radius: 999px;

  color: #247443;
  background: #e9f8ef;

  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account-profile-summary__status::before {
  content: "";
  width: 7px;
  height: 7px;
  margin-right: 6px;
  border-radius: 50%;
  background: currentColor;
}

.account-profile-summary__details {
  display: grid;
  gap: 0;
  margin-top: 24px;
  padding-top: 8px;
  border-top: 1px solid #e9ebf4;
  text-align: left;
}

.account-profile-summary__details > div {
  display: grid;
  gap: 4px;
  padding: 14px 0;
}

.account-profile-summary__details > div + div {
  border-top: 1px solid #eef0f6;
}

.account-profile-summary__details span {
  color: #8b8ea4;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-profile-summary__details strong {
  color: #1b2144;
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}


/* =========================================================
   Support card
   ========================================================= */

.account-profile-help {
  background:
    linear-gradient(
      145deg,
      #f7f8ff,
      #ffffff
    );
}

.account-profile-help h2 {
  margin: 0;
  color: #1b2144;
  font-size: 20px;
  line-height: 1.3;
}

.account-profile-help p {
  margin: 10px 0 18px;
  color: #6b6f89;
  font-size: 13px;
  line-height: 1.65;
}

.account-profile-help .btn {
  width: 100%;
}


/* =========================================================
   Personal information form
   ========================================================= */

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

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

.account-profile-form .form-group {
  display: grid;
  gap: 8px;
  min-width: 0;
}

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

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

.account-profile-form input,
.account-profile-form select,
.account-profile-form textarea {
  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-profile-form input:hover,
.account-profile-form select:hover,
.account-profile-form textarea:hover {
  border-color: #c5c9df;
}

.account-profile-form input:focus,
.account-profile-form select:focus,
.account-profile-form textarea:focus {
  border-color: #4d539f;

  box-shadow:
    0 0 0 4px rgba(77, 83, 159, 0.12);
}

.account-profile-form input[readonly] {
  color: #6b6f89;
  border-color: #e0e3ef;
  background: #f6f7fb;
  cursor: not-allowed;
}

.account-profile-form input[readonly]:focus {
  border-color: #e0e3ef;
  box-shadow: none;
}

.account-profile-form input:-webkit-autofill,
.account-profile-form input:-webkit-autofill:hover,
.account-profile-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: #1b2144;

  -webkit-box-shadow:
    0 0 0 1000px #ffffff inset;

  transition:
    background-color 9999s ease-out 0s;
}

.account-profile-form input[readonly]:-webkit-autofill {
  -webkit-text-fill-color: #6b6f89;

  -webkit-box-shadow:
    0 0 0 1000px #f6f7fb inset;
}

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

.account-profile-field-note {
  display: block;
  margin-top: 1px;
  color: #8b8ea4;
  font-size: 11px;
  line-height: 1.55;
}


/* =========================================================
   Form messages
   ========================================================= */

.account-profile-form__message {
  display: none;
  margin-top: 20px;
  padding: 13px 15px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.5;
}

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

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

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

.account-profile-form__footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid #eceef5;
}


/* =========================================================
   Invalid field states
   ========================================================= */

.account-profile-form .form-group.is-invalid input,
.account-profile-form .form-group.is-invalid select,
.account-profile-form .form-group.is-invalid textarea {
  border-color: #d85d5d;

  box-shadow:
    0 0 0 4px rgba(216, 93, 93, 0.11);
}

.account-profile-form .form-field-error {
  display: block;
  color: #a22a2a;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}


/* =========================================================
   Communication preferences
   ========================================================= */

.account-profile-preferences {
  display: grid;
  gap: 12px;
}

.account-profile-preference {
  display: grid;
  grid-template-columns:
    44px
    minmax(0, 1fr)
    auto;
  align-items: center;
  gap: 14px;

  padding: 16px;

  border: 1px solid #e1e4f0;
  border-radius: 15px;

  background: #fbfbfe;

  cursor: pointer;

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

.account-profile-preference:hover {
  transform: translateY(-1px);
  border-color: #cfd3e7;
  background: #f8f9fd;
}

.account-profile-preference:has(input:disabled) {
  cursor: default;
}

.account-profile-preference:has(input:disabled):hover {
  transform: none;
}

.account-profile-preference__icon {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 44px;
  height: 44px;

  border-radius: 13px;

  color: #4d539f;
  background: #eef0ff;
}

.account-profile-preference__icon .material-icons {
  font-size: 21px;
}

.account-profile-preference__content {
  min-width: 0;
}

.account-profile-preference__content strong {
  display: block;
  color: #1b2144;
  font-size: 14px;
  line-height: 1.35;
}

.account-profile-preference__content small {
  display: block;
  margin-top: 3px;
  color: #777b91;
  font-size: 12px;
  line-height: 1.5;
}

.account-profile-preference > input[type="checkbox"] {
  position: relative;

  width: 42px;
  height: 24px;
  min-height: 24px;
  margin: 0;

  border: 0;
  border-radius: 999px;

  background: #cfd2df;

  appearance: none;
  -webkit-appearance: none;

  cursor: pointer;

  transition:
    background 0.2s ease;
}

.account-profile-preference > input[type="checkbox"]::before {
  content: "";

  position: absolute;
  top: 3px;
  left: 3px;

  width: 18px;
  height: 18px;

  border-radius: 50%;

  background: #ffffff;

  box-shadow:
    0 2px 6px rgba(31, 25, 84, 0.22);

  transition:
    transform 0.2s ease;
}

.account-profile-preference > input[type="checkbox"]:checked {
  background: #4d539f;
}

.account-profile-preference > input[type="checkbox"]:checked::before {
  transform: translateX(18px);
}

.account-profile-preference > input[type="checkbox"]:focus-visible {
  outline: 3px solid rgba(77, 83, 159, 0.18);
  outline-offset: 3px;
}

.account-profile-preference > input[type="checkbox"]:disabled {
  opacity: 0.72;
  cursor: not-allowed;
}

.account-profile-preferences
.account-profile-form__message {
  margin-top: 8px;
}


/* =========================================================
   Account information
   ========================================================= */

.account-profile-account-info {
  display: grid;
  grid-template-columns:
    repeat(2, minmax(0, 1fr));

  overflow: hidden;

  border: 1px solid #e2e5f0;
  border-radius: 16px;
}

.account-profile-account-info > div {
  display: grid;
  gap: 6px;
  padding: 18px;
  background: #fbfbfe;
}

.account-profile-account-info > div:nth-child(even) {
  border-left: 1px solid #e2e5f0;
}

.account-profile-account-info > div:nth-child(n + 3) {
  border-top: 1px solid #e2e5f0;
}

.account-profile-account-info span {
  color: #8b8ea4;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-profile-account-info strong {
  color: #1b2144;
  font-size: 14px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.account-profile-account-info strong.is-active {
  color: #247443;
}


/* =========================================================
   Security link
   ========================================================= */

.account-profile-security-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;

  margin-top: 20px;
  padding: 17px 18px;

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

  background:
    linear-gradient(
      135deg,
      #f8f9ff,
      #ffffff
    );
}

.account-profile-security-link > div {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.account-profile-security-link
> div
> .material-icons {
  display: flex;
  align-items: center;
  justify-content: center;

  width: 42px;
  height: 42px;
  flex: 0 0 auto;

  border-radius: 13px;

  color: #ffffff;

  background:
    linear-gradient(
      135deg,
      #1f1954,
      #4d539f
    );

  font-size: 20px;
}

.account-profile-security-link strong {
  display: block;
  color: #1b2144;
  font-size: 14px;
  line-height: 1.35;
}

.account-profile-security-link p {
  margin: 3px 0 0;
  color: #777b91;
  font-size: 12px;
  line-height: 1.5;
}

.account-profile-security-link > a {
  flex: 0 0 auto;

  color: #4d539f;

  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
}

.account-profile-security-link > a:hover {
  color: #1f1954;
  text-decoration: underline;
}


/* =========================================================
   Button loading state
   ========================================================= */

.account-profile-form button[aria-busy="true"] {
  cursor: wait;
  opacity: 0.78;
}


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

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

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

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

  .account-profile-sidebar {
    position: static;
    grid-template-columns:
      repeat(2, minmax(0, 1fr));
  }
}


/* =========================================================
   Medium screens
   ========================================================= */

@media (max-width: 760px) {
  .account-profile-sidebar {
    grid-template-columns: 1fr;
  }

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

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


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

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

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

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

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

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

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

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

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

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

  .account-profile-layout,
  .account-profile-sidebar,
  .account-profile-main {
    gap: 20px;
  }

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

  .account-profile-avatar {
    width: 82px;
    height: 82px;
    font-size: 24px;
  }

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

  .account-profile-card__head h2 {
    font-size: 20px;
  }

  .account-profile-form__footer {
    align-items: stretch;
    flex-direction: column;
  }

  .account-profile-form__footer .btn {
    width: 100%;
  }

  .account-profile-preference {
    grid-template-columns:
      40px
      minmax(0, 1fr)
      auto;
    gap: 11px;
    padding: 14px;
  }

  .account-profile-preference__icon {
    width: 40px;
    height: 40px;
    border-radius: 12px;
  }

  .account-profile-preference__content strong {
    font-size: 13px;
  }

  .account-profile-preference__content small {
    font-size: 11px;
  }

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

  .account-profile-account-info > div:nth-child(even) {
    border-left: 0;
  }

  .account-profile-account-info > div:nth-child(n + 2) {
    border-top: 1px solid #e2e5f0;
  }

  .account-profile-security-link {
    align-items: flex-start;
    flex-direction: column;
  }

  .account-profile-security-link > a {
    padding-left: 55px;
  }
}


/* =========================================================
   Small mobile
   ========================================================= */

@media (max-width: 420px) {
  .account-profile-hero__inner {
    padding: 25px 20px;
  }

  .account-profile-card {
    padding: 18px;
  }

  .account-profile-preference {
    grid-template-columns:
      38px
      minmax(0, 1fr);
  }

  .account-profile-preference > input[type="checkbox"] {
    grid-column: 2;
    margin-top: 4px;
  }

  .account-profile-security-link > a {
    padding-left: 0;
  }
}