body.auth-body {
  min-height: 100vh;
  display: block;
  padding: 0;
  background: var(--bg, #f5f7fb);
}

.auth-card {
  width: min(100%, 440px);
  margin: 48px auto 64px;
  padding: 40px;
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

body.auth-body .category-tabs-bar {
  display: block;
}

body.auth-body .page-with-banners {
  min-height: 0;
}

@media (min-width: 1200px) {
  /* Keep the two configured promotion cards visible on auth pages at desktop widths. */
  body.auth-body .sponsored-card--left,
  body.auth-body .sponsored-card--right {
    display: flex !important;
  }
}

@media (max-width: 1199px) {
  /* Side banners should not cover the form on tablet and mobile layouts. */
  body.auth-body .sponsored-card--left,
  body.auth-body .sponsored-card--right {
    display: none !important;
  }
}

body.auth-body footer {
  margin-top: 0;
}

.auth-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 24px;
}

.auth-heading img {
  width: auto;
  height: 54px;
  flex-shrink: 0;
}

.auth-heading h1 {
  margin: 0;
  color: var(--text);
  font-size: 1.45rem;
  font-weight: 700;
  line-height: 1.25;
}

.auth-heading p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.auth-form-group {
  margin-bottom: 18px;
}

.auth-form-group label {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 700;
}

.auth-required {
  color: #b42318;
}

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

.auth-control-wrapper .auth-input-icon {
  position: absolute;
  top: 50%;
  left: 14px;
  color: var(--text-muted);
  transform: translateY(-50%);
  pointer-events: none;
}

.auth-control {
  width: 100%;
  min-height: 46px;
  padding: 12px 46px 12px 40px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: 0;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-control:focus {
  border-color: var(--primary);
  box-shadow: var(--focus-ring);
}

.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 4px;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.auth-password-toggle:hover {
  color: var(--primary);
  background: rgba(26, 43, 109, 0.06);
}

.auth-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: -2px 0 24px;
  font-size: 0.8rem;
}

.auth-remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.auth-remember input {
  width: 18px;
  height: 18px;
}

.auth-link {
  color: var(--primary);
  font-weight: 700;
}

.auth-submit {
  width: 100%;
  min-height: 46px;
  padding: 12px 20px;
}

.auth-oauth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 22px 0 14px;
  color: var(--text-muted);
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.auth-oauth-divider::before,
.auth-oauth-divider::after {
  flex: 1;
  height: 1px;
  background: var(--border);
  content: "";
}

.auth-oauth-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
}

.auth-oauth-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: 132px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 750;
  text-decoration: none;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.auth-oauth-button:hover {
  border-color: var(--primary);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.14);
  transform: translateY(-1px);
}

.auth-oauth-button:focus-visible {
  outline: 3px solid rgba(26, 43, 109, 0.22);
  outline-offset: 3px;
}

.auth-oauth-google {
  border-color: #d9e2f0;
}

.auth-oauth-google:hover {
  border-color: #b9cbe6;
  background: #f8fbff;
}

.auth-oauth-button i,
.auth-oauth-brand-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
}

.auth-oauth-facebook i {
  color: #fff;
  font-size: 1.1rem;
}

.auth-oauth-facebook {
  border-color: #1877f2;
  background: #1877f2;
  color: #fff;
}

.auth-oauth-facebook:hover {
  border-color: #0f5fc4;
  background: #0f5fc4;
}

.auth-oauth-label {
  position: static;
  width: auto;
  height: auto;
  padding: 0;
  overflow: visible;
  clip: auto;
  white-space: nowrap;
  border: 0;
}

.auth-notice {
  margin: 0 0 20px;
  padding: 12px 14px;
  border-left: 4px solid var(--primary);
  border-radius: 6px;
  background: rgba(26, 43, 109, 0.08);
  color: var(--text);
  font-size: 0.86rem;
  line-height: 1.55;
}

.auth-notice:empty {
  display: none;
}

.auth-notice.error {
  border-left-color: #b42318;
  background: #fef3f2;
  color: #912018;
}

.auth-helper {
  margin: 6px 0 0;
  color: var(--text-muted);
  font-size: 0.78rem;
  line-height: 1.45;
}

.auth-secondary-form {
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.auth-secondary-form h2 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 1rem;
}

.auth-secondary-form > p {
  margin: 0 0 16px;
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

.auth-switch {
  margin: 12px 0 0;
  color: var(--text-muted);
  font-size: 0.84rem;
  text-align: center;
}

.toast-region {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 1000;
  display: grid;
  gap: 10px;
}

.toast {
  max-width: min(360px, calc(100vw - 40px));
  padding: 12px 16px;
  border-radius: 10px;
  background: #166534;
  color: #fff;
  box-shadow: 0 12px 30px rgb(15 23 42 / 24%);
}

.toast.error {
  background: #b42318;
}

.auth-home-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.82rem;
  font-weight: 600;
}

@media (max-width: 576px) {
  body.auth-body {
    padding: 0;
  }

  .auth-card {
    margin: 28px 16px 48px;
    width: auto;
    padding: 28px 22px;
  }

  .auth-heading {
    align-items: flex-start;
  }

  .auth-heading img {
    height: 46px;
  }

  .auth-heading h1 {
    font-size: 1.25rem;
  }

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

@media (prefers-reduced-motion: reduce) {
  .auth-control {
    transition: none;
  }
}
