:root {
  --auth-red: #ec111a;
  --auth-red-dark: #c80e16;
  --auth-navy: #131c28;
  --auth-text: #232323;
  --auth-muted: #68717d;
  --auth-line: #d8dce1;
  --auth-soft: #f6f7f5;
  --auth-white: #ffffff;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.auth-page {
  margin: 0;
  color: var(--auth-text);
  background: var(--auth-soft);
  font-family: "Instrument Sans", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
}

.auth-shell {
  width: min(1160px, calc(100% - 40px));
  margin: 0 auto;
}

.auth-header {
  position: relative;
  z-index: 10;
  min-height: 70px;
  background: var(--auth-white);
  border-bottom: 1px solid #eceeef;
}

.auth-header__inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--auth-navy);
  font-size: 18px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.auth-brand img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 8px;
}

.auth-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.auth-nav__link {
  padding: 11px 14px;
  color: var(--auth-navy);
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.auth-nav__link:hover,
.auth-nav__link:focus-visible,
.auth-nav__link[aria-current="page"] {
  color: var(--auth-red);
  border-bottom-color: var(--auth-red);
}

.auth-button,
.auth-nav__button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 0 22px;
  color: var(--auth-white);
  background: var(--auth-red);
  border: 2px solid var(--auth-red);
  border-radius: 2px;
  font: inherit;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.auth-nav__button {
  min-height: 44px;
  margin-left: 10px;
  padding: 0 18px;
  font-size: 15px;
}

.auth-button:hover,
.auth-button:focus-visible,
.auth-nav__button:hover,
.auth-nav__button:focus-visible {
  color: var(--auth-white);
  background: var(--auth-red-dark);
  border-color: var(--auth-red-dark);
}

.auth-button svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.auth-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  padding: 0;
  align-items: center;
  justify-content: center;
  color: var(--auth-navy);
  background: #efebed;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.auth-menu-button svg {
  width: 22px;
  height: 22px;
}

.auth-main {
  padding: 72px 0 88px;
  background: var(--auth-soft);
}

.auth-main--login {
  min-height: calc(100vh - 70px - 255px);
  display: flex;
  align-items: center;
}

.auth-intro {
  max-width: 730px;
  margin-bottom: 38px;
}

.auth-eyebrow {
  margin: 0 0 12px;
  color: var(--auth-red);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-title {
  margin: 0;
  color: var(--auth-navy);
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.04;
  letter-spacing: 0;
}

.auth-lede {
  max-width: 650px;
  margin: 18px 0 0;
  color: var(--auth-muted);
  font-size: 18px;
}

.auth-panel {
  width: 100%;
  padding: 42px;
  background: var(--auth-white);
  border-top: 4px solid var(--auth-red);
  box-shadow: 0 18px 50px rgba(19, 28, 40, 0.08);
}

.auth-panel--login {
  width: min(100%, 560px);
  margin: 0 auto;
  border-top: 0;
}

.auth-panel--login .auth-panel__heading {
  margin-bottom: 30px;
}

.auth-panel--signup {
  border-top: 0;
}

.auth-panel__heading {
  margin: 0 0 8px;
  color: var(--auth-navy);
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.auth-panel__copy {
  margin: 0 0 30px;
  color: var(--auth-muted);
}

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

.auth-field--wide,
.auth-checks,
.auth-form__footer {
  grid-column: 1 / -1;
}

.auth-label {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--auth-navy);
  font-size: 14px;
  font-weight: 700;
}

.auth-required {
  color: var(--auth-red);
}

.auth-input,
.auth-select,
.auth-textarea {
  width: 100%;
  min-height: 52px;
  padding: 13px 15px;
  color: var(--auth-text);
  background: var(--auth-white);
  border: 1px solid var(--auth-line);
  border-radius: 2px;
  font: inherit;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.auth-select {
  padding-right: 42px;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--auth-navy) 50%), linear-gradient(135deg, var(--auth-navy) 50%, transparent 50%);
  background-position: calc(100% - 19px) 22px, calc(100% - 13px) 22px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.auth-textarea {
  min-height: 132px;
  resize: vertical;
}

.auth-input:focus,
.auth-select:focus,
.auth-textarea:focus {
  border-color: var(--auth-red);
  box-shadow: 0 0 0 3px rgba(236, 17, 26, 0.1);
}

.auth-input::placeholder,
.auth-textarea::placeholder {
  color: #8a9098;
}

.auth-password-wrap {
  position: relative;
}

.auth-password-wrap .auth-input {
  padding-right: 52px;
}

.auth-password-toggle {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  color: var(--auth-muted);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.auth-password-toggle svg {
  width: 20px;
  height: 20px;
}

.auth-form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 20px 0 24px;
}

.auth-checks {
  display: grid;
  gap: 14px;
  margin-top: 4px;
  padding-top: 22px;
  border-top: 1px solid #eceeef;
}

.auth-check {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 11px;
  align-items: start;
  color: #5e6670;
  font-size: 13px;
  line-height: 1.45;
  cursor: pointer;
}

.auth-check input {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--auth-red);
}

.auth-link {
  color: var(--auth-red);
  font-weight: 700;
  text-decoration: none;
}

.auth-link:hover,
.auth-link:focus-visible {
  text-decoration: underline;
}

.auth-error {
  display: none;
  margin: 0 0 22px;
  padding: 13px 15px;
  color: #8d0a10;
  background: #fff0f1;
  border-left: 4px solid var(--auth-red);
  font-size: 14px;
  font-weight: 600;
}

.auth-error.is-visible {
  display: block;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  place-items: center;
  padding: 24px;
  background: rgba(19, 28, 40, 0.62);
}

.auth-modal.is-visible {
  display: grid;
}

.auth-modal__dialog {
  position: relative;
  width: min(100%, 520px);
  padding: 42px;
  background: var(--auth-white);
  box-shadow: 0 24px 70px rgba(19, 28, 40, 0.24);
}

.auth-modal__icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  margin-bottom: 24px;
  color: var(--auth-white);
  background: var(--auth-red);
  border-radius: 50%;
}

.auth-modal__icon svg {
  width: 26px;
  height: 26px;
}

.auth-modal__title {
  margin: 0 42px 12px 0;
  color: var(--auth-navy);
  font-size: 28px;
  line-height: 1.2;
}

.auth-modal__text {
  margin: 0;
  color: var(--auth-muted);
  font-size: 17px;
  line-height: 1.6;
}

.auth-modal__close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  color: var(--auth-navy);
  background: transparent;
  border: 0;
  cursor: pointer;
}

.auth-modal__close:hover,
.auth-modal__close:focus-visible {
  color: var(--auth-red);
}

.auth-modal__close svg {
  width: 24px;
  height: 24px;
}

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

.auth-form__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding-top: 4px;
}

.auth-form__aside {
  margin: 0;
  color: var(--auth-muted);
  font-size: 14px;
}

.auth-footer {
  padding: 48px 0 26px;
  color: #d5d9df;
  background: var(--auth-navy);
}

.auth-footer__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 42px;
  padding-bottom: 38px;
}

.auth-footer .auth-brand {
  color: var(--auth-white);
}

.auth-footer__links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px 24px;
}

.auth-footer__links a {
  color: #d5d9df;
  font-size: 14px;
  text-decoration: none;
}

.auth-footer__links a:hover,
.auth-footer__links a:focus-visible {
  color: var(--auth-white);
}

.auth-footer__bottom {
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  color: #9fa6af;
  font-size: 13px;
}

.auth-footer__bottom p {
  margin: 0;
}

@media (max-width: 760px) {
  .auth-shell {
    width: min(calc(100% - 28px), 620px);
  }

  .auth-menu-button {
    display: inline-flex;
  }

  .auth-header__inner {
    flex-wrap: wrap;
    padding: 10px 0;
  }

  .auth-nav {
    width: 100%;
    display: none;
    align-items: stretch;
    flex-direction: column;
    gap: 2px;
    padding: 10px 0 6px;
  }

  .auth-nav.is-open {
    display: flex;
  }

  .auth-nav__link {
    padding: 10px 4px;
  }

  .auth-nav__button {
    margin: 6px 0 0;
  }

  .auth-main {
    padding: 48px 0 60px;
    background: var(--auth-soft);
  }

  .auth-title {
    font-size: 38px;
  }

  .auth-panel {
    padding: 28px 22px;
  }

  .auth-modal__dialog {
    padding: 32px 24px;
  }

  .auth-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .auth-field--wide,
  .auth-checks,
  .auth-form__footer {
    grid-column: auto;
  }

  .auth-form__footer,
  .auth-footer__top,
  .auth-footer__bottom {
    align-items: flex-start;
    flex-direction: column;
  }

  .auth-form__footer .auth-button {
    width: 100%;
  }

  .auth-form-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .auth-footer__links {
    justify-content: flex-start;
  }
}
