/* Общие формы входа, регистрации и восстановления пароля. */

.auth-page {
  min-height: 100vh;
  min-height: 100svh;
}

.auth-shell {
  width: min(480px, calc(100% - 32px));
  margin: 0 auto;
  padding: clamp(24px, 6vh, 64px) 0 40px;
}

.auth-brand {
  display: flex;
  justify-content: center;
  width: fit-content;
  margin: 0 auto 28px;
}

.auth-brand img {
  display: block;
  width: 138px;
  height: 45px;
}

.auth-card,
.login-modal__dialog.auth-dialog {
  padding: 28px;
  background: var(--surface);
  border: 0;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 32px rgba(43, 36, 32, 0.08);
  font-family: var(--font);
}

.login-modal__dialog.auth-dialog {
  max-width: 440px;
  max-height: calc(100dvh - 48px);
  overflow-y: auto;
  overscroll-behavior: contain;
  box-shadow: var(--shadow-lg);
}

.auth-header {
  margin-bottom: 28px;
}

.auth-icon {
  display: block;
  width: 24px;
  height: 24px;
  flex: none;
}

.auth-symbol {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  border-radius: 14px;
  background: var(--accent-soft-2);
  color: var(--accent-hover);
}

.auth-eyebrow {
  margin: 0 40px 8px 0;
  color: #73675d;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.5;
  text-transform: uppercase;
}

.auth-title,
.auth-dialog__title {
  margin: 0;
  font-family: var(--font);
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.auth-dialog__title {
  margin-right: 24px;
  font-weight: 700;
}

.auth-intro {
  margin: 12px 0 0;
  color: #73675d;
  font-size: 0.9375rem;
  line-height: 1.65;
}

.auth-form {
  display: grid;
  gap: 20px;
}

.auth-field {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.auth-label {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
}

.auth-label-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 12px;
  margin: -8px 0;
}

.auth-link {
  color: var(--accent-hover);
  font-size: 0.875rem;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.auth-link:hover {
  color: var(--accent);
  text-decoration-thickness: 2px;
}

.auth-label-row .auth-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 400;
}

.auth-input {
  width: 100%;
  min-width: 0;
  min-height: 52px;
  padding: 12px 16px;
  border: 1px solid #d8ccbb;
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
  line-height: 1.5;
}

.auth-input::placeholder {
  color: #8c8074;
}

.auth-input:focus {
  outline: none;
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft-2);
}

.auth-input[aria-invalid="true"] {
  border-color: #c0392b;
}

.auth-field__error {
  margin: 0;
  color: #9e3127;
  font-size: 0.8125rem;
  line-height: 1.5;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  margin: -4px 0;
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.5;
}

.auth-remember input {
  appearance: none;
  display: grid;
  place-content: center;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid #b9aa97;
  border-radius: 6px;
  background: var(--surface);
  cursor: pointer;
}

.auth-remember input:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.auth-remember input:checked::before {
  content: "";
  width: 10px;
  height: 6px;
  margin-top: -3px;
  border-bottom: 2px solid #fff;
  border-left: 2px solid #fff;
  transform: rotate(-45deg);
}

.auth-remember input[aria-invalid="true"] {
  border-color: #c0392b;
}

.auth-agreement {
  align-items: flex-start;
  margin: 0;
  font-weight: 400;
}

.auth-agreement input {
  margin-top: 2px;
}

.auth-agreement .auth-link {
  font: inherit;
}

.auth-form .auth-submit,
.auth-card > .auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 56px;
  padding: 14px 20px;
  border-radius: 10px;
  box-shadow: none;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
  text-align: center;
  white-space: normal;
}

.auth-submit:hover {
  transform: none;
}

.auth-help {
  margin: 0;
  color: #73675d;
  font-size: 0.8125rem;
  line-height: 1.65;
}

.auth-notice,
.auth-account {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin: 24px 0 0;
  padding: 16px;
  border-radius: 10px;
  background: var(--bg);
  color: #73675d;
  font-size: 0.8125rem;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.auth-notice .auth-icon {
  width: 20px;
  height: 20px;
  margin-top: 2px;
  color: var(--accent-hover);
}

.auth-notice p,
.auth-account p {
  margin: 0;
}

.auth-notice strong,
.auth-account strong {
  display: block;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 700;
}

.auth-account {
  margin: 0 0 24px;
}

.auth-alert {
  margin: 0 0 20px;
  padding: 12px 16px;
  border-radius: 10px;
  font-size: 0.875rem;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.auth-alert--success {
  background: var(--success-soft);
  color: #315f46;
}

.auth-alert--error {
  background: #fbe3e0;
  color: #9e3127;
}

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

.auth-form .auth-alert {
  margin: 0;
}

.auth-resend {
  margin-top: 24px;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.auth-resend summary {
  width: fit-content;
  padding: 12px 0;
  color: var(--accent-hover);
  cursor: pointer;
  font-size: 0.875rem;
  font-weight: 700;
}

.auth-resend > .auth-help {
  margin: 0 0 20px;
}

.auth-footer {
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
  color: #73675d;
  font-size: 0.875rem;
  line-height: 1.6;
  text-align: center;
}

.auth-footer a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
}

.auth-footer .auth-icon {
  width: 16px;
  height: 16px;
}

@media (max-width: 480px) {
  .auth-card,
  .login-modal__dialog.auth-dialog {
    padding: 24px 20px;
  }

  .auth-title,
  .auth-dialog__title {
    font-size: 1.6rem;
  }
}

@media (forced-colors: active) {
  .auth-remember input {
    appearance: auto;
  }

  .auth-remember input:checked::before {
    content: none;
  }
}
