/* Страницы входа / регистрации */
.auth-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.auth-page .auth-main {
  flex: 1;
  width: 100%;
  min-height: 0;
  overflow-y: auto;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 1.25rem 1rem 2.5rem;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  padding: 1.75rem 1.5rem;
  border-radius: 1rem;
  background: rgba(35, 40, 45, 0.85);
  backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] .auth-card {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(0, 0, 0, 0.08);
}

.auth-card__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.auth-card__lead {
  margin: 0 0 1.25rem;
  font-size: 0.9rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.auth-label__hint {
  font-weight: 400;
  opacity: 0.85;
}

.auth-field--password {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.auth-password-wrap {
  position: relative;
  display: block;
  width: 100%;
  min-width: 0;
}

.auth-password-wrap .auth-input {
  width: 100%;
  padding-right: 2.75rem;
}

.auth-password-toggle {
  position: absolute;
  right: 0.25rem;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.35rem;
}

.auth-password-toggle:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
}

.auth-password-toggle__icon {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.auth-optional {
  min-width: 0;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(0, 0, 0, 0.15);
}

[data-theme="light"] .auth-optional {
  border-color: rgba(0, 0, 0, 0.08);
  background: rgba(0, 0, 0, 0.03);
}

.auth-optional__summary {
  padding: 0.65rem 0.85rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.auth-optional__summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 0.35rem;
  transition: transform 0.15s ease;
}

.auth-optional[open] > .auth-optional__summary::before {
  transform: rotate(90deg);
}

.auth-optional__summary::-webkit-details-marker {
  display: none;
}

.auth-optional__body {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  padding: 0 0.85rem 0.85rem;
}

.auth-optional__row--split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 0.75rem;
  min-width: 0;
}

.auth-optional__row--split .auth-label {
  min-width: 0;
}

@media (max-width: 480px) {
  .auth-optional__row--split {
    grid-template-columns: 1fr;
  }
}

.auth-role-fieldset {
  margin: 0;
  padding: 0;
  border: none;
}

.auth-role-options {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.auth-role-option {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.65rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  font-size: 0.8125rem;
  cursor: pointer;
  color: var(--text-muted);
  white-space: nowrap;
}

.auth-role-option:has(input:checked) {
  border-color: var(--green);
  color: var(--green);
  background: rgba(5, 184, 125, 0.12);
}

.auth-role-option input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.auth-messages {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.auth-messages__item {
  padding: 0.5rem 0.75rem;
  border-radius: 0.5rem;
  font-size: 0.875rem;
  margin-bottom: 0.5rem;
}

.auth-messages__item--error {
  background: rgba(220, 80, 80, 0.2);
  color: #f0a0a0;
}

.auth-messages__item--success {
  background: rgba(5, 184, 125, 0.2);
  color: var(--green);
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  min-width: 0;
}

.auth-label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.auth-label__text {
  font-size: 0.8125rem;
  color: var(--text-muted);
}

.auth-input {
  display: block;
  width: 100%;
  min-width: 0;
  padding: 0.65rem 0.85rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-size: 1rem;
  font-family: inherit;
}

.auth-card--register {
  max-width: 440px;
}

[data-theme="light"] .auth-input {
  background: rgba(0, 0, 0, 0.04);
  border-color: rgba(0, 0, 0, 0.12);
}

.auth-input:focus {
  outline: none;
  border-color: var(--green);
  box-shadow: 0 0 0 2px rgba(5, 184, 125, 0.2);
}

.auth-submit {
  margin-top: 0.5rem;
  padding: 0.75rem 1rem;
  border: none;
  border-radius: 0.5rem;
  background: var(--green);
  color: #0a0a0a;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: filter 0.2s;
}

.auth-submit:hover {
  filter: brightness(1.08);
}

.auth-consent {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-top: 0.35rem;
  cursor: pointer;
}

.auth-consent__input {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.2rem;
  accent-color: var(--green);
  cursor: pointer;
}

.auth-consent__text {
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--text-muted);
}

.auth-consent__text a {
  color: var(--green);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-footer {
  margin: 1.25rem 0 0;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.auth-footer a {
  color: var(--green);
  font-weight: 500;
}

.auth-footer--muted {
  margin-top: 0.75rem;
  font-size: 0.8125rem;
  opacity: 0.85;
}
