/* Auth-only layout: compact centered forms, independent header/footer rhythm. */
.page-wrapper:has(.auth-page) {
  --auth-shell-width: 960px;
  --auth-form-width: 430px;
  --auth-inline: clamp(16px, 4vw, 32px);
  max-width: none;
  min-height: 100vh;
}

.page-wrapper:has(.auth-page) header {
  flex: 0 0 auto;
}

.page-wrapper:has(.auth-page) .header-inner {
  box-sizing: border-box;
  width: min(100% - (var(--auth-inline) * 2), var(--auth-shell-width));
  min-height: 56px;
  margin: 0 auto;
  padding: 12px 0;
}

.page-wrapper:has(.auth-page) .header-right {
  align-items: center;
  gap: 16px;
}

.page-wrapper:has(.auth-page) .header-right .nav-link {
  color: var(--color-text-secondary);
  font-size: 14px;
  font-weight: 500;
}

.page-wrapper:has(.auth-page) .header-right .nav-link:hover,
.page-wrapper:has(.auth-page) .header-right .nav-link:focus-visible {
  color: var(--color-text-strong);
}

.page-wrapper:has(.auth-page) .header-right .nav-link + .nav-link {
  margin-left: 0 !important;
}

main:has(.auth-page) {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: 0;
  padding: 24px var(--auth-inline);
  background: transparent;
  border-radius: 0;
}

.auth-page {
  display: flex;
  justify-content: center;
  width: 100%;
}

.auth-card {
  box-sizing: border-box;
  width: min(100%, var(--auth-form-width));
  min-width: 0;
  padding: 32px;
  border: 1px solid var(--color-border);
  border-radius: 8px;
  background: var(--color-surface);
  box-shadow: var(--shadow-sm);
}

.auth-card__header {
  margin-bottom: 22px;
}

.auth-kicker {
  margin: 0 0 8px;
  color: var(--color-primary);
  font-size: 12px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.auth-title {
  margin: 0;
  color: var(--color-text-strong);
  font-size: 30px;
  line-height: 1.15;
}

.auth-lead {
  margin: 10px 0 0;
  color: var(--color-text-secondary);
  font-size: 15px;
  line-height: 1.55;
}

.auth-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.auth-copy {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0 0 22px;
}

.auth-copy p {
  margin: 0;
  color: var(--color-text-secondary);
  font-size: 15px;
  line-height: 1.55;
}

.auth-field {
  margin-bottom: 0;
}

.auth-field .field-label,
.auth-label-row .field-label {
  margin: 0 0 7px;
  font-size: 14px;
  line-height: 1.35;
}

.auth-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
}

.auth-label-row .field-label {
  margin-bottom: 7px;
}

.auth-field input[type="text"],
.auth-field input[type="email"],
.auth-field input[type="password"] {
  width: 100%;
  max-width: none;
  min-height: 44px;
  padding: 9px 12px;
  border-color: var(--color-border-control);
  border-radius: 8px;
  background: var(--color-surface-subtle);
  font-size: 15px;
  line-height: 1.4;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}

.auth-field input[type="text"]:focus,
.auth-field input[type="email"]:focus,
.auth-field input[type="password"]:focus {
  border-color: var(--color-focus);
  background: var(--color-surface);
  outline: none;
  box-shadow: var(--focus-ring);
}

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

.auth-password-control input[type="password"],
.auth-password-control input[type="text"] {
  padding-right: 48px;
}

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

.auth-password-toggle:hover,
.auth-password-toggle:focus-visible {
  background: var(--color-surface-hover);
  color: var(--color-text);
  outline: none;
}

.auth-password-toggle:focus-visible {
  box-shadow: var(--focus-ring);
}

.auth-password-toggle__icon {
  display: inline-flex;
  line-height: 0;
}

.auth-password-toggle__icon--hide,
.auth-password-toggle.is-visible .auth-password-toggle__icon--show {
  display: none;
}

.auth-password-toggle.is-visible .auth-password-toggle__icon--hide {
  display: inline-flex;
}

.auth-field-help {
  margin: 7px 0 0;
  color: var(--color-text-muted);
  font-size: 13px;
  line-height: 1.45;
}

.auth-message {
  margin: -2px 0 0;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--color-neutral-soft);
  color: var(--color-text-secondary);
  font-size: 14px;
}

.auth-message--error {
  background: var(--color-danger-soft);
  color: var(--color-danger-text);
}

.auth-checkbox {
  margin-top: 1px;
}

.auth-checkbox label.checkbox-label {
  gap: 10px;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.45;
}

.auth-checkbox input[type="checkbox"] {
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--color-primary);
}

.auth-checkbox .checkbox-text {
  min-width: 0;
}

.auth-actions {
  margin-top: 4px;
}

.auth-card__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.btn.auth-primary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 9px 18px;
  border-color: var(--color-primary);
  border-radius: 8px;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.3;
  transition: background-color .15s ease, border-color .15s ease, box-shadow .15s ease;
}

.btn.auth-primary-btn:hover,
.btn.auth-primary-btn:focus-visible {
  border-color: var(--color-primary-hover);
  background: var(--color-primary-hover);
  color: var(--color-text-inverse);
  outline: none;
}

.btn.auth-primary-btn:focus-visible {
  box-shadow: var(--focus-ring);
}

.auth-card a.btn.auth-primary-btn,
.auth-card a.btn.auth-primary-btn:visited,
.auth-card button.btn.auth-primary-btn {
  color: var(--color-text-inverse);
}

.auth-switch {
  margin: 18px 0 0;
  color: var(--color-text-secondary);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.auth-switch a {
  font-weight: 700;
}

.page-wrapper:has(.auth-page) .footer {
  flex: 0 0 auto;
  margin: 0;
  padding: 12px var(--auth-inline) 16px;
  color: var(--color-text-muted);
}

.page-wrapper:has(.auth-page) .footer-content {
  box-sizing: border-box;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  width: min(100%, var(--auth-shell-width));
  margin: 0 auto;
  gap: 12px 22px;
  font-size: 13px;
}

.page-wrapper:has(.auth-page) .footer-left,
.page-wrapper:has(.auth-page) .footer-lang {
  flex: 0 0 auto;
}

.page-wrapper:has(.auth-page) .footer-content a {
  white-space: nowrap;
}

.page-wrapper:has(.auth-page) .footer-links {
  display: flex;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: center;
  margin: 0;
  column-gap: 18px;
  row-gap: 8px;
}

.page-wrapper:has(.auth-page) .footer-col {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  justify-content: center;
  min-width: 0;
  gap: 8px 14px;
}

.page-wrapper:has(.auth-page) .footer-lang-menu {
  right: 0;
  left: auto;
}

@media (max-width: 968px) {
  .page-wrapper:has(.auth-page) .header-inner {
    width: min(100% - 32px, var(--auth-shell-width));
  }

  main:has(.auth-page) {
    padding-top: 20px;
    padding-bottom: 20px;
  }

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

  .page-wrapper:has(.auth-page) .footer-content,
  .page-wrapper:has(.auth-page) .footer-links,
  .page-wrapper:has(.auth-page) .footer-col {
    justify-content: flex-start;
  }

  .page-wrapper:has(.auth-page) .footer-lang-menu {
    left: 0;
    right: auto;
  }
}

@media (max-width: 560px) {
  .page-wrapper:has(.auth-page) .header-inner {
    width: min(100% - 24px, var(--auth-shell-width));
    min-height: 52px;
  }

  main:has(.auth-page) {
    padding: 16px 12px;
  }

  .auth-card {
    padding: 24px 18px;
    box-shadow: none;
  }

  .page-wrapper:has(.auth-page) .footer {
    padding-left: 12px;
    padding-right: 12px;
  }
}
