@scope (.auth-layout) {
  :scope {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: var(--space-lg) var(--space-xl);
    /* Premium radial gradient overlay for background depth */
    background: radial-gradient(
      circle at center,
      light-dark(var(--blue-50), oklch(14% 0.03 240 / 0.3)) 0%,
      var(--color-background) 100%
    );
  }

  .auth-layout__content {
    width: 100%;
    max-width: 25rem;
    margin: auto;
    display: flex;
    flex-direction: column;
    animation: authFadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
  }

  /* Header & Branding Group */
  .auth-header-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    text-align: center;
    margin-bottom: var(--space-3xl); /* Robust space between logo/header and actions */
  }

  /* Branding / Logo */
  .auth-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
    text-align: center;
  }

  .auth-logo__icon {
    width: 3.25rem;
    height: 3.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-primary-muted);
    border-radius: var(--radius-xl);
    padding: var(--space-xs);
    box-shadow: 0 4px 20px light-dark(rgba(59, 130, 246, 0.1), rgba(0, 0, 0, 0.3));
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);

    &:hover {
      transform: scale(1.05) translateY(-2px);
    }
  }

  .auth-logo__text {
    display: flex;
    align-items: center;
    gap: 3px;
    font-family: var(--font-heading);
    font-size: var(--text-2xl);
    letter-spacing: var(--tracking-tight);
  }

  .auth-logo__suite {
    font-weight: var(--font-light);
    color: var(--color-text-heading);
  }

  .auth-logo__planejados {
    font-weight: var(--font-bold);
    color: var(--color-primary);
  }

  /* Header & Titles */
  .auth-header {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
  }

  .auth-title {
    font-family: var(--font-heading);
    font-size: var(--text-xl);
    font-weight: var(--font-semibold);
    color: var(--color-text-heading);
    margin: 0;
    letter-spacing: var(--tracking-tight);
  }

  .auth-subtitle {
    font-size: var(--text-body-sm);
    color: var(--color-text-secondary);
    margin: 0;
    line-height: var(--leading-relaxed);
  }

  /* Flash Alert Banners */
  .auth-flash-container {
    display: flex;
    flex-direction: column;
    gap: var(--space-xs);
    margin-bottom: var(--space-xl);
  }

  .auth-flash {
    display: flex;
    align-items: flex-start;
    gap: var(--space-sm);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-lg);
    font-size: var(--text-body-sm);
    line-height: var(--leading-normal);
    animation: flashSlideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .auth-flash--notice {
    background: var(--color-success-muted);
    color: var(--color-success-text);
    border: 1px solid light-dark(var(--emerald-200), rgba(16, 185, 129, 0.15));
  }

  .auth-flash--alert {
    background: var(--color-error-muted);
    color: var(--color-error-text);
    border: 1px solid light-dark(var(--red-200), rgba(239, 68, 68, 0.15));
  }

  .auth-flash__icon {
    flex-shrink: 0;
    margin-top: 0.125rem;

    .icon {
      width: 1.125rem;
      height: 1.125rem;
      display: block;
      stroke-linecap: round;
      stroke-linejoin: round;
    }
  }

  .auth-flash__message {
    margin: 0;
    font-weight: var(--font-medium);
  }

  /* Form & Layout elements */
  .auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
  }

  .auth-form--passkey {
    margin-top: var(--space-md);
  }

  .auth-form--magic-link {
    margin-top: var(--space-md);
  }

  .auth-form__fields {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
  }

  /* Enhance input contrast and borders in the card-less auth layout */
  .form-field {
    .form-field__input {
      background: var(--color-surface) !important;
      border: 1px solid light-dark(var(--slate-300), var(--slate-700)) !important;
      box-shadow: var(--shadow-xs);
      transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);

      &:focus-visible {
        border-color: var(--color-primary) !important;
        box-shadow: 0 0 0 3px var(--color-primary-muted) !important;
        outline: none !important;
      }
    }

    .form-field__label {
      color: var(--color-text-secondary);
      font-weight: var(--font-medium);
    }
  }

  .auth-form__submit {
    width: 100%;
    font-weight: var(--font-semibold);
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);

    &:hover {
      transform: translateY(-1px);
      box-shadow: var(--shadow-md);
    }

    &:active {
      transform: translateY(0);
      box-shadow: var(--shadow-sm);
    }
  }

  /* Custom icon support for passkey button */
  .button--passkey {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    width: 100%;

    .button__icon {
      flex-shrink: 0;
      transition: transform 0.3s ease;
    }

    &:hover .button__icon {
      transform: rotate(-10deg) scale(1.05);
    }
  }

  /* Google Social Login Styles */
  .auth-google-wrapper {
    margin-top: var(--space-xl);
    width: 100%;
  }

  .auth-google-container {
    display: flex;
    justify-content: center;
    width: 100%;
    min-height: 44px;
  }

  /* Text Divider */
  .auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--color-text-secondary);
    font-size: var(--text-body-xs);
    font-weight: var(--font-medium);
    margin: var(--space-lg) 0;

    &::before,
    &::after {
      content: "";
      flex: 1;
      border-bottom: 1px solid light-dark(var(--slate-200), var(--slate-800));
    }

    &:not(:empty)::before {
      margin-right: var(--space-sm);
    }

    &:not(:empty)::after {
      margin-left: var(--space-sm);
    }
  }

  /* Keyframe Animations */
  @keyframes authFadeIn {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }

  @keyframes flashSlideIn {
    from {
      opacity: 0;
      transform: translateY(-8px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
}
