/* auth-modal.css — Auth / Desktop / Login / Default (Figma) */

:root {
  --auth-modal-duration: 300ms;
  --auth-modal-easing: ease-in;
  --auth-modal-enter-offset: -100%;
  --auth-modal-card-w: 39.1875rem;
  --auth-modal-inner-w: 35.25rem;
  --auth-modal-fields-w: 34.4375rem;
  --auth-modal-google-w: 22.75rem;
}

.auth-modal-page__backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(1, 2, 19, 0.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--auth-modal-duration) var(--auth-modal-easing),
    visibility var(--auth-modal-duration) var(--auth-modal-easing);
  pointer-events: none;
}

.auth-modal-page__backdrop--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.auth-modal {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top, 0px))
    max(1rem, env(safe-area-inset-right, 0px))
    max(1rem, env(safe-area-inset-bottom, 0px))
    max(1rem, env(safe-area-inset-left, 0px));
  visibility: hidden;
  pointer-events: none;
}

.auth-modal--open {
  visibility: visible;
  pointer-events: auto;
}

.auth-modal__dialog {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: min(100%, var(--auth-modal-card-w));
  min-height: 27.125rem;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 1.9375rem 1.96875rem;
  background: #0b0e2e;
  border: 1px solid #252a56;
  box-shadow: 0 0 20px #000000;
  border-radius: 17px;
  transform-origin: center top;
  opacity: 0;
  transform: translateY(var(--auth-modal-enter-offset));
  transition:
    opacity var(--auth-modal-duration) var(--auth-modal-easing),
    transform var(--auth-modal-duration) var(--auth-modal-easing);
}

.auth-modal--open .auth-modal__dialog {
  opacity: 1;
  transform: translateY(0);
}

.auth-modal__inner {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 1.0625rem;
  width: min(100%, var(--auth-modal-inner-w));
}

.auth-modal__form-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  width: 100%;
}

.auth-modal__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.375rem;
}

.auth-modal__title {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.1667;
  color: #ffffff;
}

.auth-modal__subtitle {
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.875rem;
  line-height: 1.1429;
  color: #e8e8f3;
}

.auth-modal__form {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
  width: 100%;
}

.auth-modal__fields {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  width: min(100%, var(--auth-modal-fields-w));
}

.auth-modal__field {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.5rem;
  width: 100%;
}

.auth-modal__label {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1.1667;
  color: #e8e8f3;
}

.auth-modal__label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0;
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.75rem;
  line-height: 1.1667;
  color: #e8e8f3;
}

.auth-modal__label-row-sep {
  margin: 0 0.25rem;
  color: #e8e8f3;
}

.auth-modal__forgot {
  font-size: 0.625rem;
  line-height: 1.1;
  color: #a5a2c0;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.auth-modal__forgot:hover {
  color: #e8e8f3;
}

.auth-modal__control {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.625rem;
  width: 100%;
  height: 2.125rem;
  padding: 0.5rem 0.75rem;
  background: rgba(18, 23, 59, 0.8);
  border: 1px solid #2d325f;
  border-radius: 4px;
}

.auth-modal__control--password {
  padding-right: 2rem;
  position: relative;
}

.auth-modal__icon {
  flex-shrink: 0;
  color: #a5a2c0;
}

.auth-modal__icon--mail {
  width: 0.875rem;
  height: 0.625rem;
}

.auth-modal__icon--key {
  width: 0.875rem;
  height: 0.875rem;
}

.auth-modal__input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 0;
  background: transparent;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1.4661;
  color: #e8e8f3;
}

.auth-modal__input::placeholder {
  color: #a5a2c0;
}

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

.auth-modal__toggle {
  position: absolute;
  right: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.125rem;
  height: 0.75rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #a5a2c0;
  cursor: pointer;
}

.auth-modal__toggle:hover {
  color: #e8e8f3;
}

.auth-modal__toggle-icon {
  width: 1.125rem;
  height: 0.75rem;
}

.auth-modal__errors {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  width: 100%;
}

.auth-modal__errors li {
  font-size: 0.75rem;
  line-height: 1.4;
  color: #fca5a5;
}

.auth-modal__input.is-invalid {
  color: #fecaca;
}

.auth-modal__control:has(.auth-modal__input.is-invalid) {
  border-color: #f87171;
}

.auth-modal__non-field {
  width: 100%;
  padding: 0.5rem 0.75rem;
  border-radius: 4px;
  background: rgba(239, 68, 68, 0.12);
  border: 1px solid rgba(239, 68, 68, 0.35);
  font-size: 0.75rem;
  line-height: 1.4;
  color: #fca5a5;
}

.auth-modal__submit {
  display: flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  width: 100%;
  height: 2.375rem;
  padding: 0.625rem;
  border: 0;
  border-radius: 4px;
  background: #2206c7;
  box-shadow: 0 0 25px rgba(34, 6, 199, 0.25);
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.875rem;
  line-height: 1.1429;
  text-align: center;
  color: #e8e8f3;
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-modal__submit:hover {
  background: #2d12db;
  box-shadow: 0 0 28px rgba(34, 6, 199, 0.35);
}

.auth-modal__bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  width: 100%;
}

.auth-modal__divider {
  width: 100%;
  margin: 0;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1.1667;
  text-align: center;
  color: #e8e8f3;
}

.auth-modal__google-form {
  width: var(--auth-modal-google-w);
  max-width: 100%;
}

.auth-modal__google {
  box-sizing: border-box;
  display: inline-flex;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 0.75rem;
  width: 100%;
  height: 2.125rem;
  padding: 0.5rem 0.75rem;
  background: #ffffff;
  border: 1px solid #2d325f;
  border-radius: 12px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.75rem;
  line-height: 1.1667;
  text-align: center;
  color: #000000;
  text-decoration: none;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: background var(--transition-fast), box-shadow var(--transition-fast);
}

.auth-modal__google:hover {
  background: #f5f5f5;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.auth-modal__google-icon {
  flex-shrink: 0;
  width: 1.5rem;
  height: 1.5rem;
}

.auth-modal__footer {
  margin: 0;
  width: 100%;
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 0.75rem;
  line-height: 1.4661;
  text-align: center;
  color: #a5a2c0;
}

.auth-modal__footer-link {
  color: #2206c7;
  font-weight: 400;
  text-decoration: none;
  transition: color var(--transition-fast);
}

.auth-modal__footer-link:hover {
  color: #4a38e0;
}

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

@media (prefers-reduced-motion: reduce) {
  .auth-modal-page__backdrop,
  .auth-modal__dialog {
    transition: none;
  }
}

/* Mobile auth layout — auth-mobile.css */
