:root {
  --identity-accent: #3f35b5;
  --identity-accent-hover: #31288f;
  --identity-panel: #14183d;
  --identity-panel-text: #ffffff;
}

body.identity-modal-open {
  overflow: hidden;
}

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

.identity-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.identity-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.identity-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(8, 15, 34, 0.68);
  backdrop-filter: blur(5px);
}

.identity-modal__dialog {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(390px, 1fr);
  width: min(980px, 100%);
  max-height: min(720px, calc(100vh - 40px));
  overflow: hidden;
  background: #ffffff;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(5, 12, 35, 0.3);
  transform: translateY(12px) scale(0.985);
  transition: transform 180ms ease;
}

.identity-modal.is-open .identity-modal__dialog {
  transform: translateY(0) scale(1);
}

.identity-modal__close {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 4;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 50%;
  background: rgba(245, 247, 252, 0.96);
  color: #18213d;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.identity-modal__visual {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  background: var(--identity-panel);
  color: var(--identity-panel-text);
}

.identity-modal__media,
.identity-modal__visual-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.identity-modal__media {
  object-fit: cover;
}

.identity-modal__visual-overlay {
  background:
    linear-gradient(180deg, rgba(12, 19, 56, 0.3), rgba(12, 19, 56, 0.88)),
    linear-gradient(130deg, rgba(35, 45, 105, 0.4), transparent 55%);
}

.identity-modal__visual-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 650px;
  padding: 38px 38px 32px;
}

.identity-modal__logo {
  width: auto;
  max-width: 112px;
  max-height: 56px;
  object-fit: contain;
  object-position: left center;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 14px;
  padding: 8px 12px;
}

.identity-modal__welcome {
  margin-top: 58px;
  max-width: 360px;
}

.identity-modal__eyebrow {
  margin: 0 0 10px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.78;
}

.identity-modal__welcome h2 {
  margin: 0;
  font-size: clamp(32px, 4vw, 46px);
  line-height: 1.05;
}

.identity-modal__welcome p:last-child {
  margin: 18px 0 0;
  font-size: 15px;
  line-height: 1.7;
  opacity: 0.82;
}

.identity-modal__stats {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin-top: auto;
}

.identity-modal__stat {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.identity-modal__stat strong {
  color: #ffd927;
  font-size: 24px;
}

.identity-modal__stat span {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.78;
}

.identity-modal__content {
  overflow-y: auto;
  padding: 42px 34px 34px;
}

.identity-modal__tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  margin-bottom: 28px;
  background: #f0f3f9;
  border-radius: 14px;
}

.identity-modal__tab {
  padding: 11px 14px;
  border: 0;
  border-radius: 11px;
  background: transparent;
  color: #7b849e;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.identity-modal__tab.is-active {
  background: #ffffff;
  color: #171c46;
  box-shadow: 0 3px 12px rgba(26, 36, 76, 0.09);
}

.identity-modal__header h1 {
  margin: 0;
  color: #171c46;
  font-size: 26px;
}

.identity-modal__header p {
  margin: 8px 0 26px;
  color: #778099;
  font-size: 14px;
  line-height: 1.5;
}

.identity-modal__field {
  display: block;
  margin-bottom: 18px;
}

.identity-modal__field > span {
  display: block;
  margin-bottom: 8px;
  color: #30364d;
  font-size: 13px;
  font-weight: 700;
}

.identity-modal__input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid #d9dfeb;
  border-radius: 12px;
  background: #f9fbfe;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.identity-modal__input-wrap:focus-within {
  border-color: var(--identity-accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--identity-accent) 15%, transparent);
}

.identity-modal__input-icon {
  color: #8f9ab1;
  font-size: 15px;
}

.identity-modal__input-wrap input {
  flex: 1;
  min-width: 0;
  padding: 12px 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: #1c2340;
  font: inherit;
}

.identity-modal__password-toggle {
  border: 0;
  background: transparent;
  color: #8f9ab1;
  cursor: pointer;
}

.identity-modal__options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 4px 0 20px;
}

.identity-modal__remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #515a74;
  font-size: 13px;
  font-weight: 600;
}

.identity-modal__link {
  border: 0;
  background: transparent;
  color: var(--identity-accent);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.identity-modal__message {
  min-height: 20px;
  margin-bottom: 8px;
  font-size: 13px;
}

.identity-modal__message[data-type="error"] { color: #b42318; }
.identity-modal__message[data-type="success"] { color: #15803d; }
.identity-modal__message[data-type="info"] { color: #475569; }

.identity-modal__submit,
.identity-modal__social {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  border-radius: 12px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.identity-modal__submit {
  border: 0;
  background: var(--identity-accent);
  color: #ffffff;
}

.identity-modal__submit:hover {
  background: var(--identity-accent-hover);
}

.identity-modal__submit:disabled {
  opacity: 0.68;
  cursor: wait;
}

.identity-modal__separator {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 24px 0;
  color: #a1a8b8;
  font-size: 12px;
}

.identity-modal__separator::before,
.identity-modal__separator::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e3e7ef;
}

.identity-modal__social {
  border: 1px solid #d9dfeb;
  background: #ffffff;
  color: #2e3650;
}

.identity-modal__google-mark {
  font-weight: 900;
}

.identity-modal__notice {
  padding: 18px;
  margin-bottom: 18px;
  border-radius: 12px;
  background: #f4f6fb;
  color: #5a647e;
}

@media (max-width: 820px) {
  .identity-modal__dialog {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .identity-modal__visual {
    min-height: 230px;
  }

  .identity-modal__visual-content {
    min-height: 230px;
    padding: 28px;
  }

  .identity-modal__welcome {
    margin-top: 22px;
  }

  .identity-modal__welcome p:last-child,
  .identity-modal__stats {
    display: none;
  }
}

@media (max-width: 560px) {
  .identity-modal {
    padding: 0;
  }

  .identity-modal__dialog {
    width: 100%;
    min-height: 100%;
    max-height: 100%;
    border-radius: 0;
  }

  .identity-modal__visual {
    display: none;
  }

  .identity-modal__content {
    padding: 72px 22px 28px;
  }

  .identity-modal__options {
    align-items: flex-start;
  }
}
.identity-modal__visual--fallback {
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(255, 255, 255, 0.12),
      transparent 38%
    ),
    linear-gradient(
      145deg,
      var(--identity-panel, #111942),
      #080d2c
    );
}

.identity-modal__visual--fallback .identity-modal__visual-overlay {
  background: linear-gradient(
    180deg,
    rgba(9, 15, 49, 0.14) 0%,
    rgba(9, 15, 49, 0.82) 100%
  );
}