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

.auth-modal {
  --auth-ink: #1f2937;
  --auth-muted: #59665b;
  --auth-border: #dce7db;
  --auth-soft: #f3f7f2;
  --auth-accent: #46652f;
  position: fixed;
  z-index: 105000;
  inset: 0;
  display: grid;
  align-items: end;
  justify-items: center;
}

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

.auth-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(15 23 42 / .45);
  backdrop-filter: blur(3px);
  touch-action: none;
}

.auth-modal__panel {
  position: relative;
  display: flex;
  width: min(100%, 28.5rem);
  max-height: min(92vh, 52rem);
  max-height: min(92dvh, 52rem);
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--auth-border);
  border-bottom: 0;
  border-radius: 1.35rem 1.35rem 0 0;
  background: #fff;
  color: var(--auth-ink);
  box-shadow: 0 -7px 32px rgb(20 39 29 / .14);
}

.auth-modal__brand {
  display: none;
}

.auth-modal__bar {
  display: flex;
  flex: none;
  align-items: center;
  gap: .55rem;
  padding: .57rem .85rem;
  border-bottom: 1px solid #edf2eb;
  background: linear-gradient(125deg, #f2f7ef, #fff 80%);
}

.auth-modal__logo {
  width: auto;
  max-width: 45%;
  height: 1.45rem;
  object-fit: contain;
  object-position: left;
}

.auth-modal__icon-button {
  display: grid;
  width: 2.15rem;
  height: 2.15rem;
  flex: none;
  place-items: center;
  border: 1px solid var(--auth-border);
  border-radius: 50%;
  background: #f8fbf7;
  color: var(--auth-accent);
  font-size: .76rem;
  cursor: pointer;
}

.auth-modal__icon-button:hover {
  border-color: #bccdb9;
  background: #edf4eb;
}

.auth-modal__close {
  margin-inline-start: auto;
}

.auth-modal :is(.auth-modal__icon-button, .auth-modal__provider, .auth-modal__eye, .auth-modal__input) > i {
  display: block;
  flex: none;
  line-height: 1;
}

.auth-modal :is(.auth-modal__icon-button, .auth-modal__provider, .auth-modal__eye, .auth-modal__input) > i::before {
  display: block;
  vertical-align: 0;
}

.auth-modal__scroller {
  min-height: 0;
  padding: .73rem .85rem max(.95rem, env(safe-area-inset-bottom, 0px));
  overflow: auto;
  overscroll-behavior: contain;
  scroll-padding-block: .65rem;
}

.auth-modal__modes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .2rem;
  margin: 0 0 .75rem;
  padding: .22rem;
  border: 1px solid #e5ede3;
  border-radius: 999px;
  background: var(--auth-soft);
}

.auth-modal__modes > button {
  min-height: 1.95rem;
  padding: .25rem .58rem;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--auth-muted);
  font-size: .75rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-modal__modes > button:hover {
  color: var(--auth-ink);
}

.auth-modal__modes > button[aria-pressed="true"] {
  border-color: var(--auth-border);
  background: #fff;
  color: var(--auth-ink);
}

.auth-modal__title {
  margin: 0 0 .63rem;
  font-size: clamp(1.12rem, 2.2vw, 1.38rem);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.25;
}

.auth-modal__title:focus {
  outline: none;
}

.auth-modal__intro {
  margin: -.12rem 0 .82rem;
  color: var(--auth-muted);
  font-size: .78rem;
  line-height: 1.5;
}

.auth-modal__providers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .44rem;
}

.auth-modal__provider {
  display: flex;
  min-height: 2.5rem;
  align-items: center;
  justify-content: center;
  gap: .42rem;
  padding: .4rem .36rem;
  border: 1px solid var(--auth-border);
  border-radius: 999px;
  background: #fff;
  color: var(--auth-ink);
  font-size: .75rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
}

.auth-modal__provider:hover {
  border-color: #bccdb9;
  background: #f5f9f4;
}

.auth-modal__provider > img {
  object-fit: contain;
}

.auth-modal__facebook {
  color: #1877d8;
  font-size: 1rem;
}

.auth-modal__legal-copy {
  margin: .41rem 0 0;
  color: var(--auth-muted);
  font-size: .655rem;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.auth-modal__legal-copy a {
  color: var(--auth-accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: #aec5a7;
  text-underline-offset: .12em;
}

.auth-modal__divider {
  display: flex;
  align-items: center;
  gap: .55rem;
  margin: .7rem 0 .55rem;
  color: var(--auth-muted);
  font-size: .67rem;
  font-weight: 500;
}

.auth-modal__divider::before,
.auth-modal__divider::after {
  height: 1px;
  flex: 1;
  background: #e7ede6;
  content: "";
}

.auth-modal__form,
.auth-modal__field {
  display: grid;
  min-width: 0;
  gap: .5rem;
}

.auth-modal__field {
  gap: .2rem;
}

.auth-modal__field > label {
  color: var(--auth-ink);
  font-size: .71rem;
  font-weight: 600;
}

.auth-modal__input {
  display: flex;
  min-width: 0;
  min-height: 2.65rem;
  align-items: center;
  gap: .44rem;
  padding-inline: .65rem .45rem;
  border: 1px solid var(--auth-border);
  border-radius: .78rem;
  background: #f8faf8;
  color: #5b7552;
  font-size: .82rem;
}

.auth-modal__input:focus-within {
  border-color: #8fae83;
  background: #fff;
  box-shadow: 0 0 0 2px rgb(111 150 93 / .15);
}

.auth-modal__input input {
  width: 100%;
  min-width: 0;
  height: 2.55rem;
  flex: 1;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--auth-ink);
  font-size: 1rem;
  outline: none;
}

.auth-modal__input input::placeholder {
  color: #69796b;
  font-size: .76rem;
}

.auth-modal__eye {
  display: grid;
  width: 2.25rem;
  height: 2.15rem;
  flex: none;
  place-items: center;
  border-radius: 50%;
  color: var(--auth-accent);
  font-size: .88rem;
  cursor: pointer;
}

.auth-modal__eye:hover {
  background: #edf4eb;
}

.auth-modal__meter {
  display: block;
  width: 100%;
  height: .32rem;
  accent-color: #739f3a;
}

.auth-modal__login-options {
  display: flex;
  min-height: 1.85rem;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .3rem .55rem;
  padding-block: .12rem;
}

.auth-modal__remember {
  position: relative;
  display: flex;
  align-items: center;
  gap: .38rem;
  color: var(--auth-muted);
  font-size: .71rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-modal__remember > input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.auth-modal__track {
  display: flex;
  width: 2rem;
  height: 1.15rem;
  flex: none;
  align-items: center;
  padding: .125rem;
  border-radius: 999px;
  background: #dce5da;
  transition: background-color .18s ease;
}

.auth-modal__track::after {
  width: .9rem;
  height: .9rem;
  border-radius: 50%;
  background: #fff;
  transition: transform .18s ease;
  content: "";
}

.auth-modal__remember > input:checked + .auth-modal__track {
  background: #749b47;
}

.auth-modal__remember > input:checked + .auth-modal__track::after {
  transform: translateX(.85rem);
}

.auth-modal__text-button {
  padding: .2rem 0;
  color: var(--auth-accent);
  font-size: .71rem;
  font-weight: 600;
  cursor: pointer;
}

.auth-modal__text-button:hover {
  text-decoration: underline;
  text-underline-offset: .14em;
}

.auth-modal__consent {
  display: flex;
  align-items: start;
  gap: .48rem;
  padding: .59rem .62rem;
  border: 1px solid #e5ede3;
  border-radius: .75rem;
  background: var(--auth-soft);
}

.auth-modal__consent input {
  width: .95rem;
  height: .95rem;
  flex: none;
  margin: .05rem 0 0;
  accent-color: #638d41;
  cursor: pointer;
}

.auth-modal__consent label {
  display: block;
  color: var(--auth-ink);
  font-size: .71rem;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
}

.auth-modal__consent .auth-modal__legal-copy {
  margin-top: .26rem;
}

.auth-modal__submit {
  min-height: 2.65rem;
  padding: .4rem .85rem;
  border-radius: 999px;
  background: var(--auth-ink);
  color: #fff;
  font-size: .8rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.auth-modal__submit:hover {
  background: #334155;
}

.auth-modal__submit:disabled {
  opacity: .68;
  cursor: default;
}

.auth-modal__message {
  margin: 0;
  color: var(--auth-muted);
  font-size: .735rem;
  line-height: 1.4;
}

.auth-modal__message:empty {
  position: absolute;
}

.auth-modal__message:not(:empty) {
  padding: .55rem .68rem;
  border: 1px solid var(--auth-border);
  border-radius: .65rem;
  background: var(--auth-soft);
  overflow-wrap: anywhere;
}

.auth-modal__message[data-state="error"] {
  border-color: #f1d5d6;
  background: #fff4f4;
  color: #95333e;
}

.auth-modal__message[data-state="success"] {
  color: #365f36;
}

.auth-modal :is(a, button, input[type="checkbox"]):focus-visible,
.auth-modal__remember > input:focus-visible + .auth-modal__track {
  outline: 2px solid #608449;
  outline-offset: 2px;
}

@media not all and (min-width: 768px) {
  .auth-modal {
    inset-block-start: var(--auth-viewport-top, 0px);
    height: var(--auth-viewport-height, auto);
    align-items: stretch;
    background: #fff;
  }

  .auth-modal__backdrop {
    display: none;
  }

  .auth-modal__panel {
    width: 100%;
    height: 100%;
    max-height: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .auth-modal__bar {
    padding-top: max(.7rem, env(safe-area-inset-top, 0px));
    padding-right: max(.9rem, env(safe-area-inset-right, 0px));
    padding-left: max(.9rem, env(safe-area-inset-left, 0px));
  }

  .auth-modal__scroller {
    width: min(100%, 32rem);
    flex: 1;
    align-self: center;
    padding: clamp(.9rem, 2.6vh, 1.35rem) max(1rem, env(safe-area-inset-right, 0px))
      max(1rem, env(safe-area-inset-bottom, 0px)) max(1rem, env(safe-area-inset-left, 0px));
  }
}

@media (min-width: 768px) {
  .auth-modal {
    align-items: center;
    padding: 1rem;
  }

  .auth-modal__panel {
    border-bottom: 1px solid var(--auth-border);
    border-radius: 1.35rem;
    box-shadow: 0 20px 54px rgb(20 39 29 / .18);
  }

  .auth-modal__bar {
    padding: .66rem 1.05rem;
  }

  .auth-modal__scroller {
    padding: .9rem 1.05rem 1.05rem;
  }

  .auth-modal__input input {
    font-size: .84rem;
  }
}

@media (min-width: 880px) {
  .auth-modal__panel--split {
    display: grid;
    width: min(100%, 49.5rem);
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    grid-template-rows: auto minmax(0, 1fr);
  }

  .auth-modal__brand {
    display: flex;
    min-width: 0;
    flex-direction: column;
    grid-column: 1;
    grid-row: 1 / -1;
    gap: clamp(.95rem, 2.7vh, 1.5rem);
    padding: clamp(1rem, 2.25vw, 1.85rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    border-inline-end: 1px solid #22332d;
    background: radial-gradient(ellipse at 0 0, rgb(137 186 22 / .19), transparent 60%),
      linear-gradient(150deg, #172425, #111b2c 68%);
    color: #f8fafc;
  }

  .auth-modal__brand img {
    width: auto;
    max-width: 100%;
    height: 1.8rem;
    object-fit: contain;
    align-self: start;
  }

  .auth-modal__brand-title {
    margin: 0 0 .56rem;
    font-size: clamp(1.375rem, 2.45vw, 1.85rem);
    font-weight: 700;
    letter-spacing: -.04em;
    line-height: 1.16;
  }

  .auth-modal__brand-copy,
  .auth-modal__brand-info p {
    margin: 0;
    color: #c3cfd8;
    font-size: .76rem;
    line-height: 1.55;
  }

  .auth-modal__brand-info {
    display: grid;
    gap: .47rem;
    margin: 0;
    padding: 0;
    list-style: none;
  }

  .auth-modal__brand-info li {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: .57rem;
    padding: .62rem .65rem;
    border: 1px solid rgb(255 255 255 / .12);
    border-radius: .82rem;
    background: rgb(255 255 255 / .06);
  }

  .auth-modal__brand-icon {
    display: grid;
    width: 1.75rem;
    height: 1.75rem;
    place-items: center;
    border-radius: .52rem;
    background: rgb(137 186 22 / .14);
    color: #bddd88;
    font-size: .8rem;
    line-height: 1;
  }

  .auth-modal__brand-icon i::before {
    display: block;
  }

  .auth-modal__brand-info strong {
    display: block;
    margin-bottom: .14rem;
    color: #f2f6fa;
    font-size: .75rem;
    font-weight: 600;
    line-height: 1.32;
  }

  .auth-modal__brand-info p {
    font-size: .6875rem;
  }

  .auth-modal__panel--split > :is(.auth-modal__bar, .auth-modal__scroller) {
    grid-column: 2;
  }

  .auth-modal__panel--split > .auth-modal__bar {
    padding: .7rem 1.4rem .24rem;
    border-bottom: 0;
    background: #fff;
  }

  .auth-modal__panel--split .auth-modal__logo {
    display: none;
  }

  .auth-modal__panel--split > .auth-modal__scroller {
    padding: .16rem 1.4rem 1.35rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .auth-modal:not([hidden]) .auth-modal__backdrop {
    animation: auth-modal-fade .18s ease-out both;
  }

  .auth-modal:not([hidden]) .auth-modal__panel {
    animation: auth-modal-enter .22s ease-out both;
  }

  .auth-modal__screen:not([hidden]) {
    animation: auth-modal-fade .16s ease-out both;
  }

  @keyframes auth-modal-fade {
    from { opacity: 0; }
    to { opacity: 1; }
  }

  @keyframes auth-modal-enter {
    from { opacity: 0; transform: translateY(.65rem); }
    to { opacity: 1; transform: translateY(0); }
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-modal__track,
  .auth-modal__track::after {
    transition: none;
  }
}
