.rn-auth-page {
  height: 100dvh;
  min-height: 0;
  overflow: hidden;
  background: var(--rn-color-background);
}

.rn-auth-main {
  height: 100dvh;
  min-height: 0;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: clamp(var(--rn-space-2), 3dvh, var(--rn-space-6)) var(--rn-page-gutter);
}

.rn-auth-container {
  width: min(100%, calc(var(--rn-dialog-width) - var(--rn-space-8) - var(--rn-space-2)));
  max-height: 100%;
  margin-inline: auto;
}

.rn-auth-card__brand {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rn-space-5);
}

.rn-auth-product {
  display: inline-flex;
  min-height: var(--rn-control-sm);
  align-items: center;
  gap: var(--rn-space-2);
  margin: 0;
  padding-inline: var(--rn-space-3);
  color: var(--rn-color-brand-text);
  background: var(--rn-color-surface-brand);
  border: var(--rn-border-width) solid color-mix(in srgb, var(--rn-color-primary) 35%, var(--rn-color-border));
  border-radius: var(--rn-radius-pill);
  font-size: var(--rn-font-size-1);
  font-weight: var(--rn-weight-bold);
  letter-spacing: var(--rn-tracking-eyebrow);
  text-transform: uppercase;
}

.rn-auth-product span,
.rn-auth-security span {
  width: var(--rn-space-2);
  aspect-ratio: 1;
  flex: 0 0 auto;
  background: var(--rn-color-accent);
  border-radius: var(--rn-radius-pill);
  box-shadow: 0 0 0 var(--rn-space-1) color-mix(in srgb, var(--rn-color-accent) 18%, transparent);
}

.rn-auth-card {
  --rn-stack-gap: var(--rn-space-4);
  width: 100%;
  max-height: 100%;
  padding: clamp(var(--rn-space-5), 4dvh, var(--rn-space-7));
  border-radius: var(--rn-radius-xl);
}

.rn-auth-card__header {
  --rn-stack-gap: var(--rn-space-2);
}

.rn-auth-card__header h1 {
  margin: 0;
  font-size: clamp(var(--rn-font-size-8), 6vw, var(--rn-font-size-9));
  line-height: var(--rn-leading-tight);
}

.rn-auth-card__header .rn-muted {
  margin: 0;
  line-height: var(--rn-leading-body);
}

.rn-auth-form {
  --rn-stack-gap: var(--rn-space-4);
}

.rn-auth-form .rn-field__control {
  min-height: var(--rn-control-lg);
  font-size: var(--rn-font-size-4);
}

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

.rn-auth-password .rn-field__control {
  padding-right: var(--rn-space-10);
}

.rn-auth-password__toggle {
  position: absolute;
  right: var(--rn-space-1);
  top: 50%;
  min-width: var(--rn-target-min);
  min-height: var(--rn-control-md);
  padding-inline: var(--rn-space-3);
  color: var(--rn-color-brand-text);
  background: var(--rn-color-surface-soft);
  border: 0;
  border-radius: var(--rn-radius-sm);
  font-size: var(--rn-font-size-2);
  font-weight: var(--rn-weight-semibold);
  transform: translateY(-50%);
  transition: color var(--rn-duration-fast) ease, background-color var(--rn-duration-fast) ease;
}

.rn-auth-password__toggle:hover,
.rn-auth-password__toggle[aria-pressed="true"] {
  color: var(--rn-color-heading);
  background: var(--rn-color-surface-brand);
}

.rn-auth-submit {
  width: 100%;
  justify-content: space-between;
  color: var(--rn-color-on-primary);
  background: var(--rn-gradient-brand);
  border-color: var(--rn-color-primary);
}

.rn-auth-submit:hover:not(:disabled) {
  color: var(--rn-color-on-primary);
  background: var(--rn-gradient-accent);
  border-color: var(--rn-color-focus);
}

.rn-auth-submit svg {
  width: var(--rn-icon-md);
  height: var(--rn-icon-md);
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

.rn-auth-error {
  display: flex;
  flex-direction: column;
  gap: var(--rn-space-1);
  padding: var(--rn-space-4);
  color: var(--rn-color-danger);
  background: var(--rn-color-danger-surface);
  border: var(--rn-border-width) solid color-mix(in srgb, var(--rn-color-danger) 32%, var(--rn-color-border));
  border-radius: var(--rn-radius-md);
  font-size: var(--rn-font-size-3);
  line-height: var(--rn-leading-body);
}

.rn-auth-error strong {
  color: currentColor;
}

.rn-auth-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--rn-space-4);
}

.rn-auth-security,
.rn-auth-slogan {
  margin: 0;
  color: var(--rn-color-text-subtle);
  font-size: var(--rn-font-size-2);
  line-height: var(--rn-leading-body);
}

.rn-auth-security {
  display: flex;
  align-items: center;
  gap: var(--rn-space-2);
}

.rn-auth-security span {
  background: var(--rn-color-success);
  box-shadow: 0 0 0 var(--rn-space-1) color-mix(in srgb, var(--rn-color-success) 14%, transparent);
}

.rn-auth-slogan {
  max-width: 22ch;
  text-align: right;
}

@media (max-width: 599px) {
  .rn-auth-card__brand {
    flex-direction: column;
    align-items: center;
    gap: var(--rn-space-3);
  }

  .rn-auth-card__brand .rn-brand-logo {
    --rn-logo-width: calc(var(--rn-space-12) + var(--rn-space-5));
  }

  .rn-auth-card {
    padding: var(--rn-space-5);
  }

  .rn-auth-footer {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--rn-space-2);
  }

  .rn-auth-slogan {
    max-width: none;
    text-align: left;
  }
}

@media (max-height: 43rem) {
  .rn-auth-main {
    padding-block: var(--rn-space-2);
  }

  .rn-auth-card {
    --rn-stack-gap: var(--rn-space-3);
    padding: var(--rn-space-4);
  }

  .rn-auth-card__brand .rn-brand-logo {
    --rn-logo-width: var(--rn-space-12);
  }

  .rn-auth-card__header {
    --rn-stack-gap: var(--rn-space-1);
  }

  .rn-auth-card__header .rn-muted,
  .rn-auth-slogan {
    display: none;
  }

  .rn-auth-card__header h1 {
    font-size: var(--rn-font-size-8);
  }

  .rn-auth-form {
    --rn-stack-gap: var(--rn-space-3);
  }

  .rn-auth-form .rn-field {
    gap: var(--rn-space-1);
  }

  .rn-auth-form .rn-field__control,
  .rn-auth-submit {
    min-height: var(--rn-control-md);
  }

  .rn-auth-error {
    gap: var(--rn-space-0);
    padding: var(--rn-space-3);
    font-size: var(--rn-font-size-2);
  }
}

@media (prefers-reduced-motion: reduce) {
  .rn-auth-password__toggle,
  .rn-auth-submit {
    transition: none;
  }
}
